LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
#include <variant.hh>
Public Types | |
typedef variant< T0, T1 > | self_type |
The type of this variant. | |
typedef boost::variant< T0, T1 > | super_type |
Super type. |
Public Member Functions | |
template<typename U > | |
self_type & | operator= (const U &) |
variant () | |
template<typename U > | |
variant (const U &rhs) | |
operator T0 & () | |
Convert this variant to a value of type U. | |
operator T1 & () | |
operator const T0 & () const | |
operator const T1 & () const |
A wrapper over boost::variant (with two types) supporting conversion operators.
Preconditions:
Proper declaration form: misc::variant<T0, T1>
typedef variant<T0, T1> misc::variant< T0, T1 >::self_type |
The type of this variant.
typedef boost::variant<T0, T1> misc::variant< T0, T1 >::super_type |
Super type.
misc::variant< T0, T1 >::variant | ( | ) |
Constructors.
misc::variant< T0, T1 >::variant | ( | const U & | rhs | ) |
misc::variant< T0, T1 >::operator const T0 & | ( | ) | const |
Likewise, const version.
misc::variant< T0, T1 >::operator const T1 & | ( | ) | const |
misc::variant< T0, T1 >::operator T0 & | ( | ) |
Convert this variant to a value of type U.
This conversion rely on boost::get. In particular, if the conversion fails, a boost::bad_get exception is thrown.
misc::variant< T0, T1 >::operator T1 & | ( | ) |
variant< T0, T1 > & misc::variant< T0, T1 >::operator= | ( | const U & | rhs | ) |