Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit dcea408971.
PrevUpHomeNext

Function strict_get

boost::strict_get — Retrieves a value of a specified type from a given variant.

Synopsis

// In header: <boost/variant/get.hpp>


template<typename U, typename T1, typename T2, ..., typename TN> 
  U * strict_get(variant<T1, T2, ..., TN> * operand);
template<typename U, typename T1, typename T2, ..., typename TN> 
  const U * strict_get(const variant<T1, T2, ..., TN> * operand);
template<typename U, typename T1, typename T2, ..., typename TN> 
  U & strict_get(variant<T1, T2, ..., TN> & operand);
template<typename U, typename T1, typename T2, ..., typename TN> 
  const U & strict_get(const variant<T1, T2, ..., TN> & operand);
template<typename U, typename T1, typename T2, ..., typename TN> 
  U && strict_get(variant<T1, T2, ..., TN> && operand);

Description

Acts exactly like relaxed_get but does a compile time check that type U is one of the types that can be stored in variant.


PrevUpHomeNext