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 Namespace Reference

Namespaces

 detail
 

Classes

struct  _a
 
struct  _b
 
struct  _c
 
struct  _d
 
struct  _e
 
struct  _f
 
struct  _g
 
struct  _self
 The default placeholder. More...
 
struct  add_assignable
 
struct  addable
 
singleton  any
 The class template any can store any object that models a specific . More...
 
class  any< Concept, const T & >
 
class  any< Concept, T & >
 
class  any< Concept, T && >
 
struct  as_param
 Metafunction that creates a param. More...
 
struct  assignable
 Enables assignment of any types. More...
 
class  bad_any_cast
 Exception thrown when an to a reference or value fails. More...
 
class  bad_function_call
 Exception thrown when the arguments to a primitive concept are incorrect. More...
 
struct  bidirectional_iterator
 
singleton  binding
 Stores the binding of a Concept to a set of actual types. More...
 
struct  bitand_assignable
 
struct  bitandable
 
struct  bitor_assignable
 
struct  bitorable
 
struct  bitxor_assignable
 
struct  bitxorable
 
struct  callable
 
struct  callable< R(T...), F >
 
struct  callable< void(T...), F >
 
struct  complementable
 The complementable concept allow use of the bitwise complement operator on an any. More...
 
struct  concept_interface
 The concept_interface class can be specialized to add behavior to an any. More...
 
struct  concept_interface< ::boost::type_erasure::constructible< Tag(T...)>, Base, Tag >
 INTERNAL ONLY. More...
 
struct  concept_interface< add_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< add_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< addable< T, U, R >, Base, T >
 
struct  concept_interface< addable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< assignable< T, U >, Base, T >
 INTERNAL ONLY. More...
 
struct  concept_interface< bitand_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< bitand_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< bitandable< T, U, R >, Base, T >
 
struct  concept_interface< bitandable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< bitor_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< bitor_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< bitorable< T, U, R >, Base, T >
 
struct  concept_interface< bitorable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< bitxor_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< bitxor_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< bitxorable< T, U, R >, Base, T >
 
struct  concept_interface< bitxorable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< callable< R(T...), const F >, Base, F, Enable >
 
struct  concept_interface< callable< R(T...), const F >, Base, F, typename Base::_boost_type_erasure_is_callable >
 
struct  concept_interface< callable< R(T...), F >, Base, F, Enable >
 
struct  concept_interface< callable< R(T...), F >, Base, F, typename Base::_boost_type_erasure_is_callable >
 
struct  concept_interface< complementable< T, R >, Base, T >
 
struct  concept_interface< decrementable< T >, Base, T, typename::boost::enable_if< detail::should_be_const< T, Base > >::type >
 
struct  concept_interface< decrementable< T >, Base, T, typename::boost::enable_if< detail::should_be_non_const< T, Base > >::type >
 
struct  concept_interface< dividable< T, U, R >, Base, T >
 
struct  concept_interface< dividable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< divide_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< divide_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< incrementable< T >, Base, T, typename::boost::enable_if< detail::should_be_const< T, Base > >::type >
 
struct  concept_interface< incrementable< T >, Base, T, typename::boost::enable_if< detail::should_be_non_const< T, Base > >::type >
 
struct  concept_interface< left_shift_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< left_shift_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< left_shiftable< T, U, R >, Base, T >
 
struct  concept_interface< left_shiftable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< mod_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< mod_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< modable< T, U, R >, Base, T >
 
struct  concept_interface< modable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< multipliable< T, U, R >, Base, T >
 
struct  concept_interface< multipliable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< multiply_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< multiply_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< negatable< T, R >, Base, T >
 
struct  concept_interface< right_shift_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< right_shift_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< right_shiftable< T, U, R >, Base, T >
 
struct  concept_interface< right_shiftable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< subtract_assignable< T, U >, Base, T, typename::boost::disable_if< ::boost::is_same< typename::boost::type_erasure::placeholder_of< Base >::type, const T & > >::type >
 
struct  concept_interface< subtract_assignable< T, U >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_interface< subtractable< T, U, R >, Base, T >
 
struct  concept_interface< subtractable< T, U, R >, Base, U, typename::boost::disable_if< ::boost::type_erasure::is_placeholder< T > >::type >
 
struct  concept_of
 A metafunction returning the concept corresponding to an any. More...
 
struct  concept_of< ::boost::type_erasure::any< Concept, T > >
 INTERNAL ONLY. More...
 
struct  concept_of< ::boost::type_erasure::param< Concept, T > >
 INTERNAL ONLY. More...
 
struct  cons
 
struct  cons< Concept >
 
struct  cons< Concept, T0, T...>
 
struct  constructible
 
struct  constructible< R(T...)>
 
struct  copy_constructible
 The copy_constructible concept allows objects to be copied and destroyed. More...
 
struct  decrementable
 The decrementable concept allow pre and post decrement on an any. More...
 
struct  deduced
 A placeholder for an associated type. More...
 
struct  dereferenceable
 
struct  derived
 A metafunction which returns the full any type, when given any of its base classes. More...
 
struct  destructible
 The destructible concept enables forwarding to the destructor of the contained type. More...
 
struct  dividable
 
struct  divide_assignable
 
struct  equality_comparable
 
struct  forward_iterator
 
struct  incrementable
 The incrementable concept allow pre and post increment on an any. More...
 
struct  index_list
 
struct  is_placeholder
 A metafunction that indicates whether a type is a placeholder. More...
 
struct  is_placeholder< ::boost::use_default >
 INTERNAL ONLY. More...
 
struct  is_relaxed
 A metafunction indicating whether Concept includes relaxed. More...
 
struct  is_relaxed< ::boost::type_erasure::relaxed >
 INTERNAL ONLY. More...
 
struct  is_subconcept
 is_subconcept is a boolean metafunction that determines whether one concept is a sub-concept of another. More...
 
struct  is_subconcept< Sub, Super, static_binding< PlaceholderMap > >
 
struct  istreamable
 The istreamable concept allows an any to be read from a std::istream. More...
 
struct  iterator
 
struct  iterator< ::boost::bidirectional_traversal_tag, T, Reference, DifferenceType, ValueType >
 
struct  iterator< ::boost::forward_traversal_tag, T, Reference, DifferenceType, ValueType >
 
struct  iterator< ::boost::incrementable_traversal_tag, T, Reference, DifferenceType, ValueType >
 
struct  iterator< ::boost::no_traversal_tag, T, Reference, DifferenceType, ValueType >
 
struct  iterator< ::boost::random_access_traversal_tag, T, Reference, DifferenceType, ValueType >
 
struct  iterator< ::boost::single_pass_traversal_tag, T, Reference, DifferenceType, ValueType >
 
struct  iterator_reference
 INTERNAL ONLY. More...
 
struct  iterator_reference< ::boost::use_default, ValueType >
 INTERNAL ONLY. More...
 
struct  iterator_value_type
 INTERNAL ONLY. More...
 
struct  left_shift_assignable
 
struct  left_shiftable
 
struct  less_than_comparable
 
struct  mod_assignable
 
struct  modable
 
struct  multipliable
 
struct  multiply_assignable
 
struct  negatable
 The negatable concept allow use of the unary minus operator on an any. More...
 
struct  ostreamable
 The ostreamable concept allows an any to be written to a std::ostream. More...
 
singleton  param
 A wrapper to help with overload resolution for functions operating on an any. More...
 
struct  placeholder
 Placeholders are used heavily throughout the library. More...
 
struct  placeholder_of
 A metafunction returning the (const/reference qualified) placeholder corresponding to an any. More...
 
struct  placeholder_of< ::boost::type_erasure::any< Concept, T > >
 INTERNAL ONLY. More...
 
struct  placeholder_of< ::boost::type_erasure::param< Concept, T > >
 INTERNAL ONLY. More...
 
struct  random_access_iterator
 
struct  rebind_any
 A metafunction that changes the placeholder of an any. More...
 
struct  relaxed
 This special concept enables various useful default behavior that makes any act like an ordinary object. More...
 
struct  right_shift_assignable
 
struct  right_shiftable
 
struct  same_type
 A built in concept that indicates that two types are the same. More...
 
struct  static_binding
 Represents a mapping from placeholders to the actual types that they bind to. More...
 
struct  subscriptable
 
struct  subtract_assignable
 
struct  subtractable
 
class  tuple
 
class  tuple_iterator
 INTERNAL ONLY. More...
 
struct  typeid_
 Enables runtime type information. More...
 

Functions

template<class T , class Concept , class Tag >
T any_cast (any< Concept, Tag > &arg)
 Attempts to extract the object that arg holds. More...
 
template<class T , class Concept , class Tag >
T any_cast (const any< Concept, Tag > &arg)
 
template<class T , class Concept , class Tag >
T any_cast (any< Concept, Tag > *arg)
 
template<class T , class Concept , class Tag >
T any_cast (const any< Concept, Tag > *arg)
 
template<class Concept , class T >
const binding< Concept > & binding_of (const any< Concept, T > &arg)
 
template<class Concept , class Op , class... U>
typename::boost::type_erasure::detail::call_result
< Op, void(U &&...), Concept >
::type 
unchecked_call (const ::boost::type_erasure::binding< Concept > &table, const Op &, U &&...arg)
 
template<class Concept , class Op , class... U>
typename::boost::type_erasure::detail::call_result
< Op, void(U &&...), Concept >
::type 
call (const ::boost::type_erasure::binding< Concept > &table, const Op &f, U &&...arg)
 
template<class Op , class... U>
typename::boost::type_erasure::detail::call_result
< Op, void(U &&...)>::type 
unchecked_call (const Op &, U &&...arg)
 
template<class Op , class... U>
typename::boost::type_erasure::detail::call_result
< Op, void(U &&...)>::type 
call (const Op &f, U &&...arg)
 
template<class Concept , class Op , class... U>
bool check_match (const ::boost::type_erasure::binding< Concept > &table, const Op &, U &&...arg)
 
template<class Op , class... U>
bool check_match (const Op &, U &&...arg)
 
template<class T >
bool is_empty (const T &arg)
 Returns true for an empty any. More...
 
template<class Concept , class Op , class... U>
void require_match (const ::boost::type_erasure::binding< Concept > &table, const Op &op, U &&...arg)
 
template<class Op , class... U>
void require_match (const Op &op, U &&...arg)
 
template<class Map >
static_binding< Map > make_binding ()
 A convenience function to prevent constructor calls from being parsed as function declarations. More...
 
template<int N, class Concept , class... T>
typename::boost::type_erasure::detail::cons_advance
< N,::boost::type_erasure::cons
< Concept, T...>
>::type::value_type & 
get (::boost::type_erasure::tuple< Concept, T...> &t)
 
template<int N, class Concept , class... T>
const
::boost::type_erasure::detail::cons_advance
< N,::boost::type_erasure::cons
< Concept, T...>
>::type::value_type & 
get (const ::boost::type_erasure::tuple< Concept, T...> &t)
 
template<class Concept , class T >
const std::type_info & typeid_of (const any< Concept, T > &arg)
 The first form returns the type currently stored in an any. More...
 
template<class Concept , class T >
const std::type_info & typeid_of (const param< Concept, T > &arg)
 
template<class T , class Concept >
const std::type_info & typeid_of (const binding< Concept > &binding_arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

Function Documentation

template<class T , class Concept , class Tag >
T boost::type_erasure::any_cast ( any< Concept, Tag > &  arg)

Attempts to extract the object that arg holds.

If casting to a pointer fails, returns a null pointer. Casting to void* always succeeds and returns the address of stored object.

any<mpl::vector<typeid_<>, copy_constructible<> > > x(1);
any_cast<int>(x); // returns 1
any_cast<int&>(x); // returns a reference to the contents of x
any_cast<double>(x); // throws bad_any_cast
any_cast<int*>(&x); // returns a pointer to the contents of x
any_cast<void*>(&x); // returns a pointer to the contents of x
any_cast<double*>(&x); // returns NULL
Precondition
if arg is a pointer, T must be a pointer type.
Concept must contain typeid_<Tag>.
Exceptions
bad_any_castif arg doesn't contain an object of type T and we're casting to a value or reference.

References BOOST_THROW_EXCEPTION, boost::type_erasure::detail::get_pointer(), and boost::detail::type.

template<class T , class Concept , class Tag >
T boost::type_erasure::any_cast ( const any< Concept, Tag > &  arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References BOOST_THROW_EXCEPTION, boost::type_erasure::detail::get_pointer(), and boost::detail::type.

template<class T , class Concept , class Tag >
T boost::type_erasure::any_cast ( any< Concept, Tag > *  arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References BOOST_MPL_ASSERT, boost::type_erasure::detail::check_any_cast(), boost::type_erasure::detail::get_pointer(), and boost::detail::type.

template<class T , class Concept , class Tag >
T boost::type_erasure::any_cast ( const any< Concept, Tag > *  arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References BOOST_MPL_ASSERT, boost::type_erasure::detail::check_any_cast(), boost::type_erasure::detail::get_pointer(), and boost::detail::type.

template<class Concept , class T >
const binding<Concept>& boost::type_erasure::binding_of ( const any< Concept, T > &  arg)
Returns
The type bindings of an any.
Exceptions
Nothing.
template<class Concept , class Op , class... U>
typename ::boost::type_erasure::detail::call_result< Op, void(U&&...), Concept>::type boost::type_erasure::call ( const ::boost::type_erasure::binding< Concept > &  table,
const Op &  f,
U &&...  arg 
)

References require_match(), and unchecked_call().

Referenced by get().

template<class Op , class... U>
typename ::boost::type_erasure::detail::call_result< Op, void(U&&...)>::type boost::type_erasure::call ( const Op &  f,
U &&...  arg 
)
template<class Concept , class Op , class... U>
bool boost::type_erasure::check_match ( const ::boost::type_erasure::binding< Concept > &  table,
const Op &  ,
U &&...  arg 
)
template<class Op , class... U>
bool boost::type_erasure::check_match ( const Op &  ,
U &&...  arg 
)
template<int N, class Concept , class... T>
typename ::boost::type_erasure::detail::cons_advance< N, ::boost::type_erasure::cons<Concept, T...>>::type::value_type& boost::type_erasure::get ( ::boost::type_erasure::tuple< Concept, T...> &  t)

References call(), N, T, and boost::flyweights::t.

template<int N, class Concept , class... T>
const ::boost::type_erasure::detail::cons_advance< N, ::boost::type_erasure::cons<Concept, T...>>::type::value_type& boost::type_erasure::get ( const ::boost::type_erasure::tuple< Concept, T...> &  t)

References call(), N, T, and boost::flyweights::t.

template<class T >
bool boost::type_erasure::is_empty ( const T arg)

Returns true for an empty any.

References boost::proto::envns_::data.

template<class Map >
static_binding<Map> boost::type_erasure::make_binding ( )

A convenience function to prevent constructor calls from being parsed as function declarations.

template<class Concept , class Op , class... U>
void boost::type_erasure::require_match ( const ::boost::type_erasure::binding< Concept > &  table,
const Op &  op,
U &&...  arg 
)
template<class Op , class... U>
void boost::type_erasure::require_match ( const Op &  op,
U &&...  arg 
)
template<class Concept , class T >
const std::type_info& boost::type_erasure::typeid_of ( const any< Concept, T > &  arg)

The first form returns the type currently stored in an any.

The second form returns the type corresponding to a placeholder in binding.

Precondition
Concept includes typeid_<T>.
T is a non-reference, CV-unqualified placeholder.

References boost::algorithm::find(), and boost::detail::type.

Referenced by boost::type_erasure::detail::less_impl().

template<class Concept , class T >
const std::type_info& boost::type_erasure::typeid_of ( const param< Concept, T > &  arg)
template<class T , class Concept >
const std::type_info& boost::type_erasure::typeid_of ( const binding< Concept > &  binding_arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class Concept , class Op , class... U>
typename ::boost::type_erasure::detail::call_result< Op, void(U&&...), Concept>::type boost::type_erasure::unchecked_call ( const ::boost::type_erasure::binding< Concept > &  table,
const Op &  ,
U &&...  arg 
)
template<class Op , class... U>
typename ::boost::type_erasure::detail::call_result< Op, void(U&&...)>::type boost::type_erasure::unchecked_call ( const Op &  ,
U &&...  arg 
)