Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::type_erasure::any< Concept, T > Singleton Reference

The class template any can store any object that models a specific . More...

#include <rebind_any.hpp>

Inheritance diagram for boost::type_erasure::any< Concept, T >:
Collaboration diagram for boost::type_erasure::any< Concept, T >:

Public Types

typedef Concept _boost_type_erasure_concept_type
 INTERNAL ONLY. More...
 

Public Member Functions

 any (const ::boost::type_erasure::detail::storage &data_arg, const table_type &table_arg)
 INTERNAL ONLY. More...
 
 any (::boost::type_erasure::detail::storage &&data_arg, const table_type &table_arg)
 INTERNAL ONLY. More...
 
 any ()
 Constructs an empty any. More...
 
template<class U >
 any (U &&data_arg)
 Constructs an any to hold a copy of data. More...
 
template<class U , class Map >
 any (U &&data_arg, const static_binding< Map > &binding_arg)
 Constructs an any to hold a copy of data with explicitly specified placeholder bindings. More...
 
template<class U >
 any (U *data_arg)
 INTERNAL ONLY. More...
 
template<class U , class Map >
 any (U *data_arg, const static_binding< Map > &binding_arg)
 INTERNAL ONLY. More...
 
 any (const any &other)
 Copies an any. More...
 
template<class Concept2 , class Tag2 >
 any (const any< Concept2, Tag2 > &other)
 Upcasts from an any with stricter requirements to an any with weaker requirements. More...
 
template<class Concept2 , class Tag2 , class Map >
 any (const any< Concept2, Tag2 > &other, const static_binding< Map > &binding_arg)
 Constructs an any from another any. More...
 
template<class Concept2 , class Tag2 >
 any (const any< Concept2, Tag2 > &other, const binding< Concept > &binding_arg)
 Constructs an any from another any. More...
 
 any (any &&other)
 
 any (any &other)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &other)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &&other)
 
 any (const any< Concept, T & > &other)
 
 any (any< Concept, T & > &other)
 
 any (any< Concept, T & > &&other)
 
 any (const any< Concept, const T & > &other)
 
 any (any< Concept, const T & > &other)
 
 any (any< Concept, const T & > &&other)
 
template<class U , class Map >
 any (U *data_arg, static_binding< Map > &binding_arg)
 
template<class U , class Map >
 any (U *data_arg, static_binding< Map > &&binding_arg)
 
template<class U , class Map >
 any (U &&data_arg, static_binding< Map > &binding_arg)
 
template<class U , class Map >
 any (U &&data_arg, static_binding< Map > &&binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (any< Concept2, Tag2 > &other, static_binding< Map > &binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (any< Concept2, Tag2 > &other, const static_binding< Map > &binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (const any< Concept2, Tag2 > &other, static_binding< Map > &binding_arg)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &other, binding< Concept > &binding_arg)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &other, const binding< Concept > &binding_arg)
 
template<class Concept2 , class Tag2 >
 any (const any< Concept2, Tag2 > &other, binding< Concept > &binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (any< Concept2, Tag2 > &other, static_binding< Map > &&binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (const any< Concept2, Tag2 > &other, static_binding< Map > &&binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (any< Concept2, Tag2 > &&other, static_binding< Map > &&binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (any< Concept2, Tag2 > &&other, static_binding< Map > &binding_arg)
 
template<class Concept2 , class Tag2 , class Map >
 any (any< Concept2, Tag2 > &&other, const static_binding< Map > &binding_arg)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &other, binding< Concept > &&binding_arg)
 
template<class Concept2 , class Tag2 >
 any (const any< Concept2, Tag2 > &other, binding< Concept > &&binding_arg)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &&other, binding< Concept > &&binding_arg)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &&other, binding< Concept > &binding_arg)
 
template<class Concept2 , class Tag2 >
 any (any< Concept2, Tag2 > &&other, const binding< Concept > &binding_arg)
 
template<class Tag2 >
 any (const any< Concept, Tag2 > &other)
 
template<class Tag2 >
 any (any< Concept, Tag2 > &other)
 
template<class Tag2 >
 any (any< Concept, Tag2 > &&other)
 
 any (const binding< Concept > &binding_arg)
 
 any (binding< Concept > &binding_arg)
 
 any (binding< Concept > &&binding_arg)
 
template<class R , class... A, class... U>
const table_type_boost_type_erasure_extract_table (::boost::type_erasure::constructible< R(A...)> *, U &&...u)
 
template<class U0 , class U1 , class... U>
 any (U0 &&u0, U1 &&u1, U &&...u)
 
template<class U0 , class... U>
 any (const binding< Concept > &binding_arg, U0 &&u0, U &&...u)
 
template<class U0 , class... U>
 any (binding< Concept > &binding_arg, U0 &&u0, U &&...u)
 
template<class U0 , class... U>
 any (binding< Concept > &&binding_arg, U0 &&u0, U &&...u)
 
anyoperator= (const any &other)
 Assigns to an any. More...
 
template<class U >
anyoperator= (const U &other)
 Assigns to an any. More...
 
 ~any ()
 
 operator param< Concept, T & > ()&
 INTERNAL ONLY. More...
 
 operator param< Concept, T && > ()&&
 INTERNAL ONLY. More...
 

Friends

struct ::boost::type_erasure::detail::access
 

Detailed Description

template<class Concept, class T = _self>
singleton boost::type_erasure::any< Concept, T >

The class template any can store any object that models a specific .

It dispatches all the functions defined by the to the contained type at runtime.

Template Parameters
ConceptThe that the stored type should model.
TA placeholder specifying which type this is.
See also
concept_of, placeholder_of, , , ,

Member Typedef Documentation

template<class Concept, class T = _self>
typedef Concept boost::type_erasure::any< Concept, T >::_boost_type_erasure_concept_type

INTERNAL ONLY.

Constructor & Destructor Documentation

template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( const ::boost::type_erasure::detail::storage &  data_arg,
const table_type table_arg 
)
inline

INTERNAL ONLY.

template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( ::boost::type_erasure::detail::storage &&  data_arg,
const table_type table_arg 
)
inline

INTERNAL ONLY.

template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( )
inline

Constructs an empty any.

Except as otherwise noted, all operations on an empty any result in a bad_function_call exception. The copy-constructor of an empty any creates another null any. The destructor of an empty any is a no-op. Comparison operators treat all empty anys as equal. applied to an empty any returns typeid(void).

An any which does not include relaxed in its can never be null.

Precondition
relaxed must be in Concept.
Exceptions
Nothing.
See also
template<class Concept, class T = _self>
template<class U >
boost::type_erasure::any< Concept, T >::any ( U &&  data_arg)
inline

Constructs an any to hold a copy of data.

The Concept will be instantiated with the placeholder T bound to U.

Parameters
dataThe object to store in the any.
Precondition
U is a model of Concept.
U must be .
Concept must not refer to any non-deduced placeholder besides T.
Exceptions
std::bad_allocor whatever that the copy constructor of U throws.
Note
This constructor never matches if the argument is an any, binding, or static_binding.
template<class Concept, class T = _self>
template<class U , class Map >
boost::type_erasure::any< Concept, T >::any ( U &&  data_arg,
const static_binding< Map > &  binding_arg 
)
inline

Constructs an any to hold a copy of data with explicitly specified placeholder bindings.

Parameters
dataThe object to store in the any.
bindingSpecifies the types that all the placeholders should bind to.
Precondition
U is a model of Concept.
U must be .
Map is an MPL map with an entry for every non-deduced placeholder referred to by Concept.
T must map to U in Map.
Exceptions
std::bad_allocor whatever that the copy constructor of U throws.
Note
This constructor never matches if the argument is an any.
template<class Concept, class T = _self>
template<class U >
boost::type_erasure::any< Concept, T >::any ( U *  data_arg)
inline

INTERNAL ONLY.

template<class Concept, class T = _self>
template<class U , class Map >
boost::type_erasure::any< Concept, T >::any ( U *  data_arg,
const static_binding< Map > &  binding_arg 
)
inline

INTERNAL ONLY.

template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( const any< Concept, T > &  other)
inline

Copies an any.

Parameters
otherThe object to make a copy of.
Precondition
Concept must contain constructible<T(const T&)>. (This is included in copy_constructible<T>)
Exceptions
std::bad_allocor whatever that the copy constructor of the contained type throws.
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other)
inline

Upcasts from an any with stricter requirements to an any with weaker requirements.

Parameters
otherThe object to make a copy of.
Precondition
Concept must contain constructible<T(const T&)>.
Concept must not refer to any non-deduced placeholder besides T.
After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.
Exceptions
std::bad_allocor whatever that the copy constructor of the contained type throws.
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other,
const static_binding< Map > &  binding_arg 
)
inline

Constructs an any from another any.

Parameters
otherThe object to make a copy of.
bindingSpecifies the mapping between the placeholders used by the two concepts.
Precondition
Concept must contain constructible<T(const T&)>.
Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2.
After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.
Exceptions
std::bad_allocor whatever that the copy constructor of the contained type throws.
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other,
const binding< Concept > &  binding_arg 
)
inline

Constructs an any from another any.

Parameters
otherThe object to make a copy of.
bindingSpecifies the bindings of placeholders to actual types.
Precondition
Concept must contain constructible<T(const T&)>.
The type stored in other must match the type expected by binding.
Postcondition
binding_of(*this) == binding
Exceptions
std::bad_allocor whatever that the copy constructor of the contained type throws.
Warning
This constructor is potentially dangerous, as it cannot check at compile time whether the arguments match.
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( any< Concept, T > &&  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( any< Concept, T > &  other)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( const any< Concept, T & > &  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( any< Concept, T & > &  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( any< Concept, T & > &&  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( const any< Concept, const T & > &  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( any< Concept, const T & > &  other)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( any< Concept, const T & > &&  other)
inline
template<class Concept, class T = _self>
template<class U , class Map >
boost::type_erasure::any< Concept, T >::any ( U *  data_arg,
static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class U , class Map >
boost::type_erasure::any< Concept, T >::any ( U *  data_arg,
static_binding< Map > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class U , class Map >
boost::type_erasure::any< Concept, T >::any ( U &&  data_arg,
static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class U , class Map >
boost::type_erasure::any< Concept, T >::any ( U &&  data_arg,
static_binding< Map > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other,
static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other,
const static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other,
static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other,
binding< Concept > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other,
const binding< Concept > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other,
binding< Concept > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other,
static_binding< Map > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other,
static_binding< Map > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other,
static_binding< Map > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other,
static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 , class Map >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other,
const static_binding< Map > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &  other,
binding< Concept > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( const any< Concept2, Tag2 > &  other,
binding< Concept > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other,
binding< Concept > &&  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other,
binding< Concept > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Concept2 , class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept2, Tag2 > &&  other,
const binding< Concept > &  binding_arg 
)
inline
template<class Concept, class T = _self>
template<class Tag2 >
boost::type_erasure::any< Concept, T >::any ( const any< Concept, Tag2 > &  other)
inlineexplicit
template<class Concept, class T = _self>
template<class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept, Tag2 > &  other)
inlineexplicit
template<class Concept, class T = _self>
template<class Tag2 >
boost::type_erasure::any< Concept, T >::any ( any< Concept, Tag2 > &&  other)
inlineexplicit
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( const binding< Concept > &  binding_arg)
inlineexplicit
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( binding< Concept > &  binding_arg)
inlineexplicit
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::any ( binding< Concept > &&  binding_arg)
inlineexplicit
template<class Concept, class T = _self>
template<class U0 , class U1 , class... U>
boost::type_erasure::any< Concept, T >::any ( U0 &&  u0,
U1 &&  u1,
U &&...  u 
)
inline
template<class Concept, class T = _self>
template<class U0 , class... U>
boost::type_erasure::any< Concept, T >::any ( const binding< Concept > &  binding_arg,
U0 &&  u0,
U &&...  u 
)
inline
template<class Concept, class T = _self>
template<class U0 , class... U>
boost::type_erasure::any< Concept, T >::any ( binding< Concept > &  binding_arg,
U0 &&  u0,
U &&...  u 
)
inline
template<class Concept, class T = _self>
template<class U0 , class... U>
boost::type_erasure::any< Concept, T >::any ( binding< Concept > &&  binding_arg,
U0 &&  u0,
U &&...  u 
)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::~any ( )
inline
Precondition
Concept includes destructible<T>.

Member Function Documentation

template<class Concept, class T = _self>
template<class R , class... A, class... U>
const table_type& boost::type_erasure::any< Concept, T >::_boost_type_erasure_extract_table ( ::boost::type_erasure::constructible< R(A...)> *  ,
U &&...  u 
)
inline
template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::operator param< Concept, T & > ( )
inline

INTERNAL ONLY.

template<class Concept, class T = _self>
boost::type_erasure::any< Concept, T >::operator param< Concept, T && > ( )
inline

INTERNAL ONLY.

template<class Concept, class T = _self>
any& boost::type_erasure::any< Concept, T >::operator= ( const any< Concept, T > &  other)
inline

Assigns to an any.

If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other.

Exceptions
Whateverthe assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc or whatever the copy constructor of the contained type throws. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides.
template<class Concept, class T = _self>
template<class U >
any& boost::type_erasure::any< Concept, T >::operator= ( const U &  other)
inline

Assigns to an any.

If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other.

Exceptions
Whateverthe assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc or whatever the copy constructor of the contained type throws. In this case assignment provides the strong exception guarantee. When calling an assignment operator of the contained type, the exception guarantee is whatever the contained type provides.

Friends And Related Function Documentation

template<class Concept, class T = _self>
friend struct ::boost::type_erasure::detail::access
friend

The documentation for this singleton was generated from the following file: