KrisLibrary
1.0.0
|
A polymorphic container class that can contain data of any type. More...
#include <AnyValue.h>
Public Member Functions | |
template<typename ValueType > | |
AnyValue (const ValueType &value) | |
AnyValue (const AnyValue &other) | |
AnyValue (AnyValue &&other) noexcept | |
AnyValue & | swap (AnyValue &rhs) |
template<typename ValueType > | |
AnyValue & | operator= (const ValueType &rhs) |
AnyValue & | operator= (const AnyValue &rhs) |
bool | empty () const |
const std::type_info & | type () const |
template<class T > | |
bool | hastype () const |
template<class ValueType > | |
bool | operator== (const ValueType &rhs) const |
template<class ValueType > | |
bool | operator!= (const ValueType &rhs) const |
Friends | |
template<typename ValueType > | |
ValueType * | AnyCast (AnyValue *) |
Retreive the data within the operand, or NULL if not of the correct type. | |
template<typename ValueType > | |
ValueType * | AnyCast_Quick (AnyValue *) |
template<typename ValueType > | |
ValueType * | AnyCast_Raw (AnyValue *) |
A polymorphic container class that can contain data of any type.
To retrieve the contained data, use AnyCast.
|
friend |
Retreive the data within the operand, or NULL if not of the correct type. This differs from AnyCast in that it checks for the correct typeid by reference rather than by value, which does not work across DLL boundaries but is faster.
|
friend |
Retreive the data within the operand, or NULL if the operand is NULL. This differs from AnyCast in that it does not check for the correct type, which slightly improves performance, at the cost of requiring the caller to first verify type The caller must be very sure that the item's type is correct!