Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Class template any<Concept, const T &>

boost::type_erasure::any<Concept, const T &>

Synopsis

// In header: <boost/type_erasure/any.hpp>

template<typename Concept, typename T> 
class any<Concept, const T &> {
public:
  // construct/copy/destruct
  template<typename U> any(const U &);
  template<typename U, typename Map> 
    any(const U &, const static_binding< Map > &);
  any(const any &);
  any(const any< Concept, T & > &);
  any(const any< Concept, T > &);
  any(const any< Concept, T && > &);
  template<typename Concept2, typename Tag2> 
    any(const any< Concept2, Tag2 > &);
  template<typename Concept2, typename Tag2, typename Map> 
    any(const any< Concept2, Tag2 > &, const static_binding< Map > &);
  template<typename Concept2, typename Tag2> 
    any(const any< Concept2, Tag2 > &, const binding< Concept > &);
  any & operator=(const any &);
  template<typename U> any & operator=(const U &);
};

Description

any public construct/copy/destruct

  1. template<typename U> any(const U & arg);

    Constructs an any from a reference.

    Parameters:

    arg

    The object to bind the reference to.

    Requires:

    U is a model of Concept.

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

    Throws:

    Nothing.
  2. template<typename U, typename Map> 
      any(const U & arg, const static_binding< Map > & binding);

    Constructs an any from a reference.

    Parameters:

    arg

    The object to bind the reference to.

    binding

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

    Requires:

    U is a model of Concept.

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

    Throws:

    Nothing.
  3. any(const any & other);

    Constructs an any from another any.

    Parameters:

    other

    The reference to copy.

    Throws:

    Nothing.
  4. any(const any< Concept, T & > & other);

    Constructs an any from another any.

    Parameters:

    other

    The reference to copy.

    Throws:

    Nothing.
  5. any(const any< Concept, T > & other);

    Constructs an any from another any.

    Parameters:

    other

    The object to bind the reference to.

    Throws:

    Nothing.
  6. any(const any< Concept, T && > & other);

    Constructs an any from another any.

    Parameters:

    other

    The object to bind the reference to.

    Throws:

    Nothing.
  7. template<typename Concept2, typename Tag2> 
      any(const any< Concept2, Tag2 > & other);

    Constructs an any from another any.

    Parameters:

    other

    The object to bind the reference to.

    Requires:

    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.

    Throws:

    std::bad_alloc
  8. template<typename Concept2, typename Tag2, typename Map> 
      any(const any< Concept2, Tag2 > & other, 
          const static_binding< Map > & binding);

    Constructs an any from another any.

    Parameters:

    binding

    Specifies the mapping between the two concepts.

    other

    The object to bind the reference to.

    Requires:

    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.

    Throws:

    std::bad_alloc
  9. template<typename Concept2, typename Tag2> 
      any(const any< Concept2, Tag2 > & other, const binding< Concept > & binding);

    Constructs an any from another any.

    Parameters:

    binding

    Specifies the bindings of placeholders to actual types.

    other

    The object to bind the reference to.

    Requires:

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

    Postconditions:

    binding_of(*this) == binding

    Throws:

    Nothing.
  10. any & operator=(const any & other);

    Assigns to an any.

    Requires:

    relaxed is in Concept.

    Throws:

    Nothing.
  11. template<typename U> any & operator=(const U & other);

    Assigns to an any.

    Requires:

    relaxed is in Concept.

    Throws:

    std::bad_alloc. Provides the strong exception guarantee.

PrevUpHomeNext