![]() |
Home | Libraries | People | FAQ | More |
boost::any — A class whose instances can hold instances of any type that satisfies ValueType requirements.
// In header: <boost/any.hpp> class any { public: // construct/copy/destruct (); (any &); (any &&); template<typename ValueType> (); template<typename ValueType> (); any & (any &); any & (any &&); template<typename ValueType> any & (); template<typename ValueType> any & (); ~(); // modifiers any & (any &); // queries () ; std::type_info & () ; };
any
public
construct/copy/destruct();
Postconditions: |
this->empty() |
(any & other);
Effects: |
Copy constructor that copies content of
other into new instance, so that any content
is equivalent in both type and value to the content of
other , or empty if other is
empty. |
Throws: |
May fail with a
std::bad_alloc
exception or any exceptions arising from the copy
constructor of the contained type. |
(any && other);
Effects: |
Move constructor that moves content of
other into new instance and leaves other
empty. |
Postconditions: |
other->empty() |
Throws: |
Nothing. |
template<typename ValueType> ( value);
Effects: |
Makes a copy of value , so
that the initial content of the new instance is equivalent
in both type and value to
value . |
Throws: |
std::bad_alloc
or any exceptions arising from the copy constructor of the
contained type. |
template<typename ValueType> ( value);
Effects: |
Forwards value , so
that the initial content of the new instance is equivalent
in both type and value to
value before the forward. |
Throws: |
std::bad_alloc
or any exceptions arising from the copy constructor of the
contained type. |
any & (any & rhs);
Effects: |
Copies content of rhs into
current instance, discarding previous content, so that the
new content is equivalent in both type and value to the
content of rhs , or empty if
rhs.empty() . |
Throws: |
std::bad_alloc
or any exceptions arising from the copy constructor of the
contained type. Assignment satisfies the strong guarantee
of exception safety. |
any & (any && rhs);
template<typename ValueType> any & ( rhs);
Effects: |
Makes a copy of rhs ,
discarding previous content, so that the new content of is
equivalent in both type and value to
rhs . |
Throws: |
std::bad_alloc
or any exceptions arising from the copy constructor of the
contained type. Assignment satisfies the strong guarantee
of exception safety. |
template<typename ValueType> any & ( rhs);
Effects: |
Forwards rhs ,
discarding previous content, so that the new content of is
equivalent in both type and value to
rhs before forward. |
Throws: |
std::bad_alloc
or any exceptions arising from the move or copy constructor of the
contained type. Assignment satisfies the strong guarantee
of exception safety. |
~();
Effects: |
Releases any and all resources used in management of instance. |
Throws: |
Nothing. |