Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template param

boost::type_erasure::param — A wrapper to help with overload resolution for functions operating on an any.

Synopsis

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

template<typename Concept, typename T> 
class param {
public:
  // construct/copy/destruct
  template<typename U> (any< Concept, U > &);
  template<typename U> (const any< Concept, U > &);
  template<typename U> (any< Concept, U > &&);

  // public member functions
  any< Concept, T > () ;
};

Description

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.

[Note] Note

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:

param public construct/copy/destruct

  1. template<typename U> (any< Concept, U > & a);
  2. template<typename U> (const any< Concept, U > & a);
  3. template<typename U> (any< Concept, U > && a);

param public member functions

  1. any< Concept, T > () ;

    Returns the stored any.


PrevUpHomeNext