Lunchbox
1.8.0
|
A class which can hold instances of any type. More...
#include <any.h>
Public Member Functions | |
Construction/Destruction | |
Any () | |
Construct a new, empty Any. | |
template<typename ValueType > | |
Any (const ValueType &value) | |
Construct a new Any with the given value. | |
Any (const Any &other) | |
Copy-construct a new Any with copying content of other. | |
~Any () | |
Destruct this Any. | |
Modifiers | |
Any & | swap (Any &rhs) |
Exchange the content of this and rhs. | |
template<typename ValueType > | |
Any & | operator= (const ValueType &rhs) |
Assign a new value to this Any. | |
Any & | operator= (Any rhs) |
Exchange the content of this and rhs. | |
Queries | |
bool | empty () const |
const std::type_info & | type () const |
bool | operator== (const Any &rhs) const |
bool | operator!= (const Any &rhs) const |
Friends | |
class | boost::serialization::access |
template<typename ValueType > | |
ValueType * | any_cast (Any *) |
Retrieve the value stored in an Any including type checking. | |
template<typename ValueType > | |
ValueType * | unsafe_any_cast (Any *) |
Retrieve the value stored in an Any without type checking. |
A class which can hold instances of any type.
This class is based on boost.any with the extension to support serialization through boost.serialization if the the ValueType supports this type of serialization.
lunchbox::Any::Any | ( | ) |
Construct a new, empty Any.
Referenced by operator=().
|
inline |
lunchbox::Any::Any | ( | const Any & | other | ) |
Copy-construct a new Any with copying content of other.
lunchbox::Any::~Any | ( | ) |
Destruct this Any.
bool lunchbox::Any::empty | ( | ) | const |
|
inline |
|
inline |
bool lunchbox::Any::operator== | ( | const Any & | rhs | ) | const |
const std::type_info& lunchbox::Any::type | ( | ) | const |
Referenced by lunchbox::any_cast().
|
friend |
|
friend |