Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/variant-o.hpp"
A variant wrapper (typesafe union) capable of holding a value of any of a bounded collection of types.
The value is stored in a local buffer directly within the object and may be accessed by a typesafe visitation.
TYPES | collection of possible types to be stored in this variant object |
Access | policy how to access the stored value |
Definition at line 253 of file variant-o.hpp.
Public Member Functions | |
template<typename TAR > | |
TAR | get () |
retrieve current content of the variant, trying to cast or convert it to the given type. More... | |
template<typename SRC > | |
VariantO & | operator= (SRC src) |
store a copy of the given argument within the variant holder buffer, thereby typically casting or converting the given source type to the best suited (base) type (out of the collection of possible types for this VariantO instance) | |
void | reset () |
Private Types | |
typedef Holder::Deleter | Deleter |
typedef variant::Holder< TYPES > | Holder |
Private Attributes | |
Holder::Storage | holder_ |
storage: buffer holding either an "empty" marker, or an instance of one of the configured payload types | |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
|
inline |
retrieve current content of the variant, trying to cast or convert it to the given type.
Actually, the function access(T&)
on the Access-policy (template param) is invoked with the type currently stored in the holder buffer. May return NULL if conversion fails.
Definition at line 293 of file variant-o.hpp.
Referenced by WrappedStandardExeBuilder::__call__().