Lunchbox
1.6.0
|
A class which can hold instances of any type. More...
#include <any.h>
Classes | |
class | holder |
class | placeholder |
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.
Construct a new, empty Any.
Referenced by operator=().
lunchbox::Any::Any | ( | const ValueType & | value | ) | [inline] |
lunchbox::Any::Any | ( | const Any & | other | ) |
Copy-construct a new Any with copying content of other.
Destruct this Any.
bool lunchbox::Any::empty | ( | ) | const |
bool lunchbox::Any::operator!= | ( | const Any & | rhs | ) | const [inline] |
Any& lunchbox::Any::operator= | ( | const ValueType & | rhs | ) | [inline] |
bool lunchbox::Any::operator== | ( | const Any & | rhs | ) | const |
Any& lunchbox::Any::swap | ( | Any & | rhs | ) |
Exchange the content of this and rhs.
const std::type_info& lunchbox::Any::type | ( | ) | const |
Referenced by lunchbox::any_cast().
ValueType* unsafe_any_cast | ( | Any * | operand | ) | [friend] |