The Concept that the stored type should model.

boost::type_erasure::_self

_self

A `placeholder` specifying which type this is.

The class template `any` can store any object that models a specific Concept. It dispatches all the functions defined by the Concept to the contained type at runtime.

See Also:

`concept_of`, `placeholder_of`, any_cast, is_empty, binding_of, typeid_of

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. typeid_of applied to an empty `any` returns `typeid(void)`.

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

See Also:

is_empty

`relaxed` must be in `Concept`.

`Nothing.`

U &&

The object to store in the `any`.

Constructs an `any` to hold a copy of `data`. The `Concept` will be instantiated with the placeholder `T` bound to U.

This constructor never matches if the argument is an `any`, `binding`, or `static_binding`.

`U` is a model of `Concept`.

`U` must be CopyConstructible.

`Concept` must not refer to any non-deduced placeholder besides `T`.

`std::bad_alloc` or whatever that the copy constructor of `U` throws.

U &&

The object to store in the `any`.

const `static_binding`< Map > &

Specifies the types that all the placeholders should bind to.

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

This constructor never matches if the argument is an `any`.

`U` is a model of `Concept`.

`U` must be CopyConstructible.

`Map` is an MPL map with an entry for every non-deduced placeholder referred to by `Concept`.

``T` must` map to `U` in `Map`.

`std::bad_alloc` or whatever that the copy constructor of `U` throws.

const `any` &

The object to make a copy of.

Copies an `any`.

`Concept` must contain `constructible<T(const T&)>`. (This is included in `copy_constructible<T>`)

`std::bad_alloc` or whatever that the copy constructor of the contained type throws.

const `any`< Concept2, Tag2 > &

The object to make a copy of.

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

`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`.

`std::bad_alloc` or whatever that the copy constructor of the contained type throws.

const `any`< Concept2, Tag2 > &

The object to make a copy of.

const `static_binding`< Map > &

Specifies the mapping between the placeholders used by the two concepts.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc` or whatever that the copy constructor of the contained type throws.

const `any`< Concept2, Tag2 > &

The object to make a copy of.

const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

Constructs an `any` from another `any`.

This constructor is potentially dangerous, as it cannot check at compile time whether the arguments match.

`Concept` must contain `constructible<T(const T&)>`.

The type stored in `other` must match the type expected by `binding`.

binding_of(*this) == `binding`

`std::bad_alloc` or whatever that the copy constructor of the contained type throws.

class...
U &&...

The arguments to be passed to the underlying constructor.

Calls a constructor of the contained type. The bindings will be deduced from the arguments.

This constructor is never chosen if any other constructor can be called instead.

`Concept` must contain an instance of `constructible` which can be called with these arguments.

At least one of the arguments must by an `any` with the same `Concept` as this.

The bindings of all the arguments that are `any`'s, must be the same.

`std::bad_alloc` or whatever that the constructor of the contained type throws.

class...
const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

U &&...

The arguments to be passed to the underlying constructor.

Calls a constructor of the contained type.

`Concept` must contain a matching instance of `constructible`.

The contained type of every argument that is an `any`, must be the same as that specified by `binding`.

binding_of(*this) == `binding`

`std::bad_alloc` or whatever that the constructor of the contained type throws.

`any` & `U &&`

Assigns to an `any`.

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

If `U` is an `any`, then this can decide dynamically whether to use construction based on the type stored in other.

`Whatever` the assignment operator of the contained type throws. When falling back on construction, throws `std::bad_alloc` or whatever the move (or copy) constructor of the contained type throws. In this case move assignment provides the strong exception guarantee. When calling a (move) assignment operator of the contained type, the exception guarantee is whatever the contained type provides.

`Concept` includes `destructible<T>`.

Concept
const T &
const U &

The object to bind the reference to.

Constructs an `any` from a reference.

`U` is a model of `Concept`.

`Concept` must not refer to any non-deduced placeholder besides `T`.

`Nothing.`

const U &

The object to bind the reference to.

const `static_binding`< Map > &

Specifies the actual types that all the placeholders should bind to.

Constructs an `any` from a reference.

`U` is a model of `Concept`.

`Map` is an MPL map with an entry for every non-deduced placeholder referred to by `Concept`.

`Nothing.`

const `any` &

The reference to copy.

Constructs an `any` from another `any`.

`Nothing.`

const `any`< Concept, T & > &

The reference to copy.

Constructs an `any` from another `any`.

`Nothing.`

const `any`< Concept, T > &

The object to bind the reference to.

Constructs an `any` from another `any`.

`Nothing.`

const `any`< Concept, T && > &

The object to bind the reference to.

Constructs an `any` from another `any`.

`Nothing.`

const `any`< Concept2, Tag2 > &

The object to bind the reference to.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc`

const `any`< Concept2, Tag2 > &

The object to bind the reference to.

const `static_binding`< Map > &

Specifies the mapping between the two concepts.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc`

const `any`< Concept2, Tag2 > &

The object to bind the reference to.

const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

Constructs an `any` from another `any`.

The type stored in `other` must match the type expected by `binding`.

binding_of(*this) == `binding`

`Nothing.`

`any` & `const `any` &`

Assigns to an `any`.

`relaxed` is in `Concept`.

`Nothing.`

`any` & `const U &`

Assigns to an `any`.

`relaxed` is in `Concept`.

`std::bad_alloc.` Provides the strong exception guarantee.

Concept
T &
U &

The object to bind the reference to.

Constructs an `any` from a reference.

`U` is a model of `Concept`.

`Concept` must not refer to any non-deduced placeholder besides `T`.

`Nothing.`

U &

The object to bind the reference to.

const `static_binding`< Map > &

Specifies the actual types that all the placeholders should bind to.

Constructs an `any` from a reference.

`U` is a model of `Concept`.

`Map` is an MPL map with an entry for every non-deduced placeholder referred to by `Concept`.

`Nothing.`

const `any` &

The reference to copy.

Constructs an `any` from another reference.

`Nothing.`

any
< Concept, T > &

The object to bind the reference to.

Constructs an `any` from another `any`.

`Nothing.`

const `any`< Concept2, Tag2 & > &

The reference to copy.

Constructs an `any` from another reference.

`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`.

`std::bad_alloc`

any
< Concept2, Tag2 > &

The object to bind the reference to.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc`

const `any`< Concept2, Tag2 & > &

The reference to copy.

const `static_binding`< Map > &

Specifies the mapping between the two concepts.

Constructs an `any` from another reference.

`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`.

`std::bad_alloc`

any
< Concept2, Tag2 > &

The object to bind the reference to.

const `static_binding`< Map > &

Specifies the mapping between the two concepts.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc`

const `any`< Concept2, Tag2 & > &

The reference to copy.

const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

Constructs an `any` from another reference.

The type stored in `other` must match the type expected by `binding`.

binding_of(*this) == `binding`

`Nothing.`

any
< Concept2, Tag2 > &

The object to bind the reference to.

const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

Constructs an `any` from another `any`.

The type stored in `other` must match the type expected by `binding`.

binding_of(*this) == `binding`

`Nothing.`

`any` & `U &&`

Assigns to an `any`.

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

`Whatever` the assignment operator of the contained type throws. When falling back on construction, can only throw `std::bad_alloc` if `U` is an `any` that uses a different `Concept`. 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.

Concept
T &&
U &&

The object to bind the reference to.

Constructs an `any` from a reference.

`U` is a model of `Concept`.

`Concept` must not refer to any non-deduced placeholder besides `T`.

`Nothing.`

U &&

The object to bind the reference to.

const `static_binding`< Map > &

Specifies the actual types that all the placeholders should bind to.

Constructs an `any` from a reference.

`U` is a model of `Concept`.

`Map` is an MPL map with an entry for every non-deduced placeholder referred to by `Concept`.

`Nothing.`

any
< Concept, T > &&

The reference to copy.

The object to bind the reference to.

Constructs an `any` from another rvalue reference.

`Nothing.Constructs` an `any` from another `any`.

`Nothing.`

any
< Concept2, Tag2 && > &&

The reference to copy.

Constructs an `any` from another rvalue reference.

`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`.

`std::bad_alloc`

any
< Concept2, Tag2 > &&

The object to bind the reference to.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc`

const `any`< Concept2, Tag2 && > &

The reference to copy.

const `static_binding`< Map > &

Specifies the mapping between the two concepts.

Constructs an `any` from another reference.

`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`.

`std::bad_alloc`

any
< Concept2, Tag2 > &&

The object to bind the reference to.

const `static_binding`< Map > &

Specifies the mapping between the two concepts.

Constructs an `any` from another `any`.

`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`.

`std::bad_alloc`

const `any`< Concept2, Tag2 && > &

The reference to copy.

const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

Constructs an `any` from another rvalue reference.

The type stored in `other` must match the type expected by `binding`.

binding_of(*this) == `binding`

`Nothing.`

any
< Concept2, Tag2 > &&

The object to bind the reference to.

const `binding`< Concept > &

Specifies the bindings of placeholders to actual types.

Constructs an `any` from another `any`.

The type stored in `other` must match the type expected by `binding`.

binding_of(*this) == `binding`

`Nothing.`

`any` & `U &&`

Assigns to an `any`.

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

`Whatever` the assignment operator of the contained type throws. When falling back on construction, can only throw `std::bad_alloc` if `U` is an `any` that uses a different `Concept`. 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.

`any`< Concept, T & >
`any`< Concept, const T & >
`any`< Concept, T && >
T ``any`< Concept, Tag > &`
T `const `any`< Concept, Tag > &`
T ``any`< Concept, Tag > *`
T `const `any`< Concept, Tag > *`

Attempts to extract the object that `arg` holds. If casting to a pointer fails, any_cast 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

if `arg` is a pointer, `T` must be a pointer type.

`Concept` must contain `typeid_<Tag>`.

`bad_any_cast` if `arg` doesn't contain an object of type `T` and we're casting to a value or reference.

Stores the binding of a `Concept` to a set of actual types. `Concept` is interpreted in the same way as with `any`.

friend bool `const `binding` &` `const `binding` &`

true iff the sets of types that the placeholders bind to are the same for both arguments.

`Nothing.`

friend bool `const `binding` &` `const `binding` &`

true iff the arguments do not map to identical sets of types.

`Nothing.`

`relaxed` must be in `Concept`.

`Nothing.`

const Map &

`Map` must be an MPL map with an entry for each placeholder referred to by `Concept`.

`Nothing.`

const `static_binding`< Map > &

`Map` must be an MPL map with an entry for each placeholder referred to by `Concept`.

`Nothing.`

const `binding`< Concept2 > &
const Map &

Converts from another set of bindings.

Map must be an MPL map with an entry for each placeholder referred to by `Concept`. The mapped type should be the corresponding placeholder in Concept2.

`std::bad_alloc`

const `binding`< Concept2 > &
const `static_binding`< Map > &

Converts from another set of bindings.

Map must be an MPL map with an entry for each placeholder referred to by `Concept`. The mapped type should be the corresponding placeholder in Concept2.

`std::bad_alloc`

const `dynamic_binding`< Placeholders > &
const `static_binding`< Map > &

Converts from another set of bindings.

Map must be an MPL map with an entry for each placeholder referred to by `Concept`. The mapped type should be the corresponding placeholder in Concept2.

`std::bad_alloc`

const `binding`< Concept > & `const `any`< Concept, T > &`

The type bindings of an `any`.

`Nothing.`

boost::type_erasure::_self

_self
const T&

Enables assignment of `any` types.

void `T &` `U`

boost::type_erasure::_self

_self
boost::mpl::vector< constructible< T(const T &)>, destructible< T > >

The `copy_constructible` concept allows objects to be copied and destroyed.

This concept is defined to match C++ 2003, [lib.copyconstructible]. It is not equivalent to the concept of the same name in C++11.

boost::type_erasure::_self

_self

The `destructible` concept enables forwarding to the destructor of the contained type. This is required whenever an `any` is created by value.

The `destructible` concept rarely needs to be specified explicitly, because it is included in the `copy_constructible` concept.

`destructible` may not be specialized and may not be passed to call as it depends on the implementation details of `any`.

boost::type_erasure::_self

_self

Enables runtime type information. This is required if you want to use any_cast or typeid_of.

`typeid_` cannot be specialized because several library components including any_cast would not work correctly if its behavior changed. There is no need to specialize it anyway, since it works for all types. `typeid_` also cannot be passed to call. To access it, use typeid_of.

unspecified class... `const `binding`< Concept > &` `const Op &` `U &&...`
unspecified class... `const Op &` `U &&...`

Dispatches a type erased function.

`Op` must be a primitive concept which is present in `Concept`. Its signature determines how the arguments of call are handled. If the argument is a `placeholder`, call expects an `any` using that `placeholder`. This `any` is unwrapped by call. The type that it stores must be the same type specified by `binding`. Any arguments that are not placeholders in the signature of `Op` are passed through unchanged.

If `binding` is not specified, it will be deduced from the arguments. Naturally this requires at least one argument to be an `any`. In this case, all `any` arguments must have the same `binding`.

Example:

    typedef mpl::vector<
      copy_constructible<_b>,
      addable<_a, int, _b> > concept;
    any<concept, _a> a = ...;
    any<concept, _b> b(call(addable<_a, int, _b>(), a, 10));

The signature of `addable` is `_b(const _a&, const int&)`

The result of the operation. If the result type of the signature of `Op` is a placeholder, the result will be converted to the appropriate `any` type.

`bad_function_call` if `relaxed` is in `Concept` and there is a type mismatch.

boost::type_erasure::_self

_self

The `callable` concept allows an `any` to hold function objects. `Sig` is interpreted in the same way as for Boost.Function, except that the arguments and return type are allowed to be placeholders. `F` must be a `placeholder`.

Multiple instances of `callable` can be used simultaneously. Overload resolution works normally. Note that unlike Boost.Function, `callable` does not provide result_type. It does, however, support `boost::result_of`.

R `F &` `T...`

`R` is the result type of `Sig` and `T` is the argument types of `Sig`.

bool class... `const `binding`< Concept > &` `const Op &` `U &&...`
bool class... `const Op &` `U &&...`

If `relaxed` is in `Concept`, checks whether the arguments to `f` match the types specified by `binding`. If `relaxed` is not in `Concept`, returns true. If `binding` is not specified, it will be deduced from the arguments.

The concept that we're specializing `concept_interface` for. One of its placeholders should be `ID`.

The base of this class. Specializations of `concept_interface` must inherit publicly from this type.

The placeholder representing this type.

void

A dummy parameter that can be used for SFINAE.

Base

The `concept_interface` class can be specialized to add behavior to an `any`. An `any` inherits from all the relevant specializations of `concept_interface`.

`concept_interface` can be specialized for either primitive or composite concepts. If a concept `C1` contains another concept `C2`, then the library guarantees that the specialization of `concept_interface` for `C2` is a base class of the specialization for `C1`. This means that `C1` can safely override members of `C2`.

`concept_interface` may only be specialized for user-defined concepts. The library owns the specializations of its own built in concepts.

The metafunctions `derived`, `rebind_any`, and `as_param` (which can be applied to `Base`) are useful for determining the argument and return types of functions defined in `concept_interface`.

For dispatching the function use call.

A metafunction returning the concept corresponding to an `any`. It will also work for all bases of `any`, so it can be applied to the `Base` parameter of `concept_interface`.

unspecified
typename ::`boost::type_erasure::concept_of`< T >::type

The maximum number of functions that an `any` can have.

The maximum number of arguments that functions in the library support.

The maximum number of elements in a `tuple`.

The `constructible` concept enables calling the constructor of a type contained by an `any`. `Sig` should be a function signature. The return type is the placeholder specifying the type to be constructed. The arguments are the argument types of the constructor. The arguments of `Sig` may be placeholders.

`constructible` may not be specialized and may not be passed to call as it depends on the implementation details of `any`.

boost::type_erasure::placeholder

A placeholder for an associated type. The type corresponding to this placeholder is deduced by substituting placeholders in the arguments of the metafunction and then evaluating it.

When using `deduced` in a template context, if it is possible for Metafunction to contain no placeholders at all, use the nested type, to automatically evaluate it early as needed.

unspecified

A metafunction which returns the full `any` type, when given any of its base classes. This is primarily intended to be used when implementing `concept_interface`.

See Also:

`rebind_any`, `as_param`

unspecified
typename T::_boost_type_erasure_derived_type
R `Any &&`
R `Any &&` `const `static_binding`< Map > &`

Downcasts or crosscasts an `any`.

The single argument form can only be used when `R` uses a single non-deduced placeholder.

Example:

    // Assume that typeid_<>, copy_constructible<>, and incrementable<>
    // have all been registered for int.
    any<mpl::vector<typeid_<>, copy_constructible<> > > x(1);
    typedef any<
        mpl::vector<
            typeid_<>,
            copy_constructible<>,
            incrementable<>
        >
    > incrementable_any;
    auto y = dynamic_any_cast<incrementable_any>(x);
    ++y;
    assert(any_cast<int>(y) == 2);

`R` and `Any` must both be specializations of `any`.

PlaceholderMap must be an MPL map with a key for every non-deduced placeholder used by R. The value associated with each key should be the corresponding placeholder in Any.

The concept of Any must include `typeid_`, for every `placeholder` which is used by R.

`bad_any_cast` if the concepts used by R were not previously registered via a call to register_binding.

Maps a set of placeholders to actual types.

const `static_binding`< Map > &
const `binding`< Concept > &
const `static_binding`< Map > &
bad_cast

Exception thrown when an any_cast to a reference or value fails.

invalid_argument

Exception thrown when the arguments to a primitive concept are incorrect.

See Also:

call, require_match

is the name of the concept to declare. If it is omitted it defaults to `has_ ## function_name`

is the name of the function.

Defines a primitive concept for a free function.

The declaration of the concept is

    template<class Sig>
    struct concept_name;

where Sig is a function type giving the signature of the function.

This macro can only be used at namespace scope.

Example:

    BOOST_TYPE_ERASURE_FREE(to_string)
    typedef has_to_string<std::string(_self const&)> to_string_concept;

In C++03, the macro can only be used in the global namespace and is defined as:

    #define BOOST_TYPE_ERASURE_FREE(qualified_name, function_name, N)

Example:

    BOOST_TYPE_ERASURE_FREE((boost)(has_to_string), to_string, 1)

For backwards compatibility, this form is always accepted.

bool `const T &`

Returns true for an empty `any`.

A metafunction that indicates whether a type is a `placeholder`.

The sub concept

The super concept

void

(optional) An MPL map with keys for every non-deduced placeholder in Sub. The associated value of each key is the corresponding placeholder in Super. If `PlaceholderMap` is omitted, `Super` and `Sub` are presumed to use the same set of placeholders.

`is_subconcept` is a boolean metafunction that determines whether one concept is a sub-concept of another.

    is_subconcept<incrementable<>, incrementable<> >             -> true
    is_subconcept<incrementable<>, addable<> >                   -> false
    is_subconcept<incrementable<_a>, forward_iterator<_iter>,
      mpl::map<mpl::pair<_a, _iter> > >                          -> true

boost::type_erasure::_self

_self
boost::use_default
std::ptrdiff_t
boost::type_erasure::iterator< boost::bidirectional_traversal_tag, T, Reference, DifferenceType >

boost::type_erasure::_self

_self
boost::use_default
std::ptrdiff_t
boost::type_erasure::iterator< boost::forward_traversal_tag, T, Reference, DifferenceType >

must be one of `boost::incrementable_traversal_tag`, `boost::single_pass_traversal_tag`, `boost::forward_traversal_tag`, `boost::bidirectional_traversal_tag`, and `boost::random_access_traversal_tag`.

boost::type_erasure::_self

_self

The placeholder representing the iterator.

boost::use_default

The reference type. If it is boost::use_default, then reference will be value_type&.

std::ptrdiff_t

The iterator's difference type.

The `iterator` concept can be used for any iterator category.

The value_type of the iterator is deduced. To force it to be a specific type, use the `same_type` concept.

Example:

    mpl::vector<
      iterator<boost::forward_traversal_tag>,
      same_type<iterator<boost::forward_traversal_tag>::value_type, int> > int_it;

unspecified
Reference
DifferenceType

boost::type_erasure::_self

_self
boost::use_default
std::ptrdiff_t
boost::type_erasure::iterator< boost::random_access_traversal_tag, T, Reference, DifferenceType >

is the name of the concept to declare. If it is omitted it defaults to `has_ ## member`

is the name of the member function.

Defines a primitive concept for a member function.

The declaration of the concept is

    template<class Sig, class T = _self>
    struct concept_name;

where `Sig` is a function type giving the signature of the member function, and `T` is the object type. `T` may be const-qualified for const member functions. `concept_name<R(A...) const, T>` is an alias for `concept_name<R(A...), const T>`.

This macro can only be used at namespace scope.

Example:

    namespace boost {
    BOOST_TYPE_ERASURE_MEMBER(push_back)
    }
    typedef boost::has_push_back<void(int)> push_back_concept;

The concept defined by this function may be specialized to provide a concept_map. The class object will be passed by reference as the first parameter.

    template<>
    struct has_push_back<void(int), std::list<int> > {
      static void apply(std::list<int>& l, int i) { l.push_back(i); }
    };

In C++03, the macro can only be used in the global namespace and is defined as:

    #define BOOST_TYPE_ERASURE_MEMBER(qualified_name, member, N)

Example:

    BOOST_TYPE_ERASURE_MEMBER((boost)(has_push_back), push_back, 1)
    typedef boost::has_push_back<void(int), _self> push_back_concept;

For backwards compatibility, this form is always accepted.

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T

The `complementable` concept allow use of the bitwise complement operator on an `any`.

R `const T &`

boost::type_erasure::_self

_self

The `decrementable` concept allow pre and post decrement on an `any`. The contained type must provide a pre-decrement operator.

void `T &`

boost::type_erasure::_self

_self
R `const T &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
bool `const T &` `const U &`

boost::type_erasure::_self

_self

The `incrementable` concept allow pre and post increment on an `any`. The contained type must provide a pre-increment operator.

void `T &`
std::istream

boost::type_erasure::_self

_self

The `istreamable` concept allows an `any` to be read from a `std::istream`.

void `Is &` `T &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
bool `const T &` `const U &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T

The `negatable` concept allow use of the unary minus operator on an `any`.

R `const T &`
std::ostream

boost::type_erasure::_self

_self

The `ostreamable` concept allows an `any` to be written to a `std::ostream`.

void `Os &` `const T &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`

boost::type_erasure::_self

_self
std::ptrdiff_t
R `T &` `const N &`

boost::type_erasure::_self

_self
T
void `T &` `const U &`

boost::type_erasure::_self

_self
T
T
R `const T &` `const U &`
Metafunction that creates a `param`.

If `T` is a (cv/reference qualified) placeholder, returns `param`<`concept_of<Any>::type`, T>, otherwise, returns T. This metafunction is intended to be used for function arguments in specializations of `concept_interface`.

See Also:

`derived`, `rebind_any`

unspecified
A wrapper to help with overload resolution for functions operating on an `any`.

The template arguments are interpreted in the same way as `any`.

A parameter of type `param` can be initialized with an `any` that has the same `Concept` and base placeholder when there exists a corresponding standard conversion for the placeholder. A conversion sequence from `any<C, P>` to `param<C, P1>` is a better conversion sequence than `any<C, P>` to `param<C, P2>` iff the corresponding placeholder standard conversion sequence from P to P1 is a better conversion sequence than P to P2.

Overloading based on cv-qualifiers and rvalue-ness is only supported in C++11. In C++03, all conversion sequences from `any` to `param` have the same rank.

Example:

    void f(param<C, _a&>);
    void f(param<C, const _a&>);
    void g(param<C, const _a&>);
    void g(param<C, _a&&>);

    any<C, _a> a;
    f(any<C, _a>()); // calls void f(param<C, const _a&>);
    f(a);            // calls void f(param<C, _a&>); (ambiguous in C++03)
    g(any<C, _a>()); // calls void g(param<C, _a&&>); (ambiguous in C++03)
    g(a);            // calls void g(param<C, const _a&>);

`any`< Concept, T >

Returns the stored `any`.

any
< Concept, U > &
const `any`< Concept, U > &
any
< Concept, U > &&
typename ::`boost::type_erasure::as_param`< Any, T >::type
boost::type_erasure::placeholder
boost::type_erasure::placeholder
boost::type_erasure::placeholder
boost::type_erasure::placeholder
boost::type_erasure::placeholder
boost::type_erasure::placeholder
boost::type_erasure::placeholder
boost::type_erasure::placeholder
The default placeholder.

`_self` is the default `placeholder` used by `any`. It should be used as a default by most concepts, so using concepts with no explicit arguments will "just work" as much as possible.

Placeholders are used heavily throughout the library. Every placeholder must derive from `placeholder`. The library provides a number of placeholders, out of the box, but you are welcome to define your own, if you want more descriptive names. The placeholder `_self` is special in that it is used as the default wherever possible.

What exactly is a placeholder? Placeholders act as a substitute for template parameters in concepts. The library automatically replaces all the placeholders used in a concept with the actual types involved when it stores an object in an `any`.

For example, in the following,

    any<copy_constructible<_a>, _a> x(1);

The library sees that we're constructing an `any` that uses the `_a` placeholder with an `int`. Thus it binds `_a` to int and instantiates `copy_constructible<int>`.

When there are multiple placeholders involved, you will have to use `tuple`, or pass the bindings explicitly, but the substitution still works the same way.

A metafunction returning the (const/reference qualified) placeholder corresponding to an `any`. It will also work for all bases of `any`, so it can be applied to the `Base` parameter of `concept_interface`.

unspecified
typename ::`boost::type_erasure::placeholder_of`< T >::type

A metafunction that changes the `placeholder` of an `any`. If `T` is not a placeholder, returns `T` unchanged. This class is intended to be used in `concept_interface` to deduce the argument types from the arguments of the concept.

    rebind_any<any<Concept>, _a>::type -> any<Concept, _a>
    rebind_any<any<Concept>, _b&>::type -> any<Concept, _b&>
    rebind_any<any<Concept>, _c&&>::type -> any<Concept, _c&&>
    rebind_any<any<Concept>, int>::type -> int

See Also:

`derived`, `as_param`

unspecified
typename ::`boost::type_erasure::rebind_any`< Any, T >::type
void `const `static_binding`< Map > &`
void

Registers a model of a concept to allow downcasting `any` via dynamic_any_cast.

A metafunction indicating whether `Concept` includes `relaxed`.

boost::mpl::vector0<>

This special concept enables various useful default behavior that makes `any` act like an ordinary object. By default `any` forwards all operations to the underlying type, and provides only the operations that are specified in its `Concept`.

In detail, `relaxed` enables the following:

- A raw value can be assigned to an `any`. This will replace the value stored by the `any`. (But note that if `assignable` is present, it takes priority.)

- assignment of `any` uses the constructor if it can't use `assignable` (either because `assignable` is missing, or because the stored types do not match).

- default construction of `any` is allowed and creates a null any.

- `equality_comparable`: If the types do not match, it will return false.

- `less_than_comparable`: If the types do not match, the ordering will be according to `std::type_info::before`.

- if the arguments to any other function do not match, it will throw a `bad_function_call` exception instead of having undefined behavior.

void class... `const `binding`< Concept > &` `const Op &` `U &&...`
void class... `const Op &` `U &&...`

Checks that the actual types stored in all the `any` arguments match the types specified by `binding`. If they do not match then,

- If `relaxed` is in `Concept`, throws `bad_function_call`.

- Otherwise the behavior is undefined.

If `binding` is not specified, it will be deduced from the arguments.

call`(binding, f, args...)` is valid.

A built in concept that indicates that two types are the same. Either T or U or both can be placeholders.

Any number of instances of `deduced` can be connected with `same_type`, but there should be at most one regular placeholder in the group. same_type<_a, _b> is not allowed. The reason for this is that the library needs to normalize all the placeholders, and in this context there is no way to decide whether to use `_a` or `_b`.

Represents a mapping from placeholders to the actual types that they bind to.

Map
`static_binding`< Map >

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

class...

`tuple` is a Boost.Fusion Random Access Sequence containing `anys`. `Concept` specifies the Concept for each of the elements. The remaining arguments must be (possibly const and/or reference qualified) placeholders, which are the `placeholders` of the elements.

class...
U &&...

Constructs a tuple. Each element of `args` will be used to initialize the corresponding `any` member. The `binding` for the tuple elements is determined by mapping the placeholders in `T` to the corresponding types in `U`.

`any`< Concept, TN > & int class... ``tuple`< Concept, T... > &`
const `any`< Concept, TN > & int class... `const `tuple`< Concept, T... > &`

Returns the Nth `any` in the tuple.

const std::type_info & `const `any`< Concept, T > &`
const std::type_info & `const `binding`< Concept > &`

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

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

`Concept` includes `typeid_<T>`.

`T` is a non-reference, CV-unqualified `placeholder`.