rili::Variant< Types > Struct Template Reference
Inheritance diagram for rili::Variant< Types >:
[legend]

Public Member Functions

 Variant ()
 
 Variant (const Variant< Types... > &other)
 
 Variant (Variant< Types... > &&other)
 
Variant< Types... > & operator= (Variant< Types... > &&other)
 
Variant< Types... > & operator= (Variant< Types... > const &other)
 
template<typename T >
bool is () const
 
bool valid ()
 
template<typename T , typename... Args>
void set (Args &&...args)
 
template<typename T >
T & get ()
 
template<typename T >
T const & get () const
 

Constructor & Destructor Documentation

template<typename... Types>
rili::Variant< Types >::Variant ( )
inline

Variant initialize Variant with invalid value.

template<typename... Types>
rili::Variant< Types >::Variant ( const Variant< Types... > &  other)
inline

Variant copy constructor.

Parameters
otherother Variant
template<typename... Types>
rili::Variant< Types >::Variant ( Variant< Types... > &&  other)
inline

Variant move constructor.

Parameters
otherother Variant

Member Function Documentation

template<typename... Types>
template<typename T >
T& rili::Variant< Types >::get ( )
inline

used to get value of Variant

Warning
if type T is not equal to currently stored type in Variant std::bad_cast will be thrown
Returns
current Variant value
template<typename... Types>
template<typename T >
T const& rili::Variant< Types >::get ( ) const
inline

used to get value of Variant

Returns
current Variant value
Warning
if type T is not equal to currently stored type in Variant std::bad_cast will be thrown
template<typename... Types>
template<typename T >
bool rili::Variant< Types >::is ( ) const
inline

Check if currently stored value in Variant is given T type.

Returns
true is types match, false otherwise
template<typename... Types>
Variant<Types...>& rili::Variant< Types >::operator= ( Variant< Types... > &&  other)
inline

operator = is Variant move assignment operator

Parameters
otherother Variant
Returns
template<typename... Types>
Variant<Types...>& rili::Variant< Types >::operator= ( Variant< Types... > const &  other)
inline

operator = is Variant copy assignment operator

Parameters
otherother Variant
Returns
template<typename... Types>
template<typename T , typename... Args>
void rili::Variant< Types >::set ( Args &&...  args)
inline

used to set value of Variant and change type if needed

Parameters
argsvalue to be set
template<typename... Types>
bool rili::Variant< Types >::valid ( )
inline

valid check if Variant is correctly initialized

Returns
true is correctly initialized, false otherwise

The documentation for this struct was generated from the following file: