Lunchbox
1.12.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
A class which can hold instances of any type. More...
#include <any.h>
Public Member Functions | |
Construction/Destruction | |
LUNCHBOX_API | Any () |
Construct a new, empty Any. More... | |
template<typename ValueType > | |
Any (const ValueType &value) | |
Construct a new Any with the given value. More... | |
LUNCHBOX_API | Any (const Any &other) |
Copy-construct a new Any with copying content of other. More... | |
LUNCHBOX_API | ~Any () |
Destruct this Any. More... | |
Modifiers | |
LUNCHBOX_API Any & | swap (Any &rhs) |
Exchange the content of this and rhs. More... | |
template<typename ValueType > | |
Any & | operator= (const ValueType &rhs) |
Assign a new value to this Any. More... | |
LUNCHBOX_API Any & | operator= (Any rhs) |
Exchange the content of this and rhs. More... | |
Queries | |
LUNCHBOX_API bool | empty () const |
LUNCHBOX_API const std::type_info & | type () const |
LUNCHBOX_API 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. More... | |
template<typename ValueType > | |
ValueType * | unsafe_any_cast (Any *) |
Retrieve the value stored in an Any without type checking. More... | |
A class which can hold instances of any type.
This class is based on boost.any with the extension to support serialization if the ValueType supports boost.serialization.
Example:
LUNCHBOX_API lunchbox::Any::Any | ( | ) |
Construct a new, empty Any.
Referenced by operator=().
|
inline |
LUNCHBOX_API lunchbox::Any::Any | ( | const Any & | other | ) |
Copy-construct a new Any with copying content of other.
LUNCHBOX_API lunchbox::Any::~Any | ( | ) |
Destruct this Any.
LUNCHBOX_API bool lunchbox::Any::empty | ( | ) | const |
|
inline |
|
inline |
Exchange the content of this and rhs.
LUNCHBOX_API bool lunchbox::Any::operator== | ( | const Any & | rhs | ) | const |
Exchange the content of this and rhs.
LUNCHBOX_API const std::type_info& lunchbox::Any::type | ( | ) | const |
Referenced by lunchbox::any_cast().
|
friend |
|
friend |