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::param< Concept, T > Singleton Reference

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

#include <placeholder_of.hpp>

Public Types

typedef void _boost_type_erasure_is_any
 INTERNAL ONLY. More...
 
typedef param _boost_type_erasure_derived_type
 INTERNAL ONLY. More...
 

Public Member Functions

template<class U >
 param (any< Concept, U > &a, typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< U, T > >::type *=0)
 
template<class U >
 param (const any< Concept, U > &a, typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< typename::boost::add_const< U >::type, T > >::type *=0)
 
template<class U >
 param (any< Concept, U > &&a, typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< U &&, T > >::type *=0)
 
any< Concept, Tget () const
 Returns the stored any. More...
 

Friends

struct boost::type_erasure::detail::access
 

Detailed Description

template<class Concept, class T>
singleton boost::type_erasure::param< Concept, T >

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.

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:

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&>);

Member Typedef Documentation

template<class Concept, class T>
typedef param boost::type_erasure::param< Concept, T >::_boost_type_erasure_derived_type

INTERNAL ONLY.

template<class Concept, class T>
typedef void boost::type_erasure::param< Concept, T >::_boost_type_erasure_is_any

INTERNAL ONLY.

Constructor & Destructor Documentation

template<class Concept, class T>
template<class U >
boost::type_erasure::param< Concept, T >::param ( any< Concept, U > &  a,
typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< U, T > >::type = 0 
)
inline
template<class Concept, class T>
template<class U >
boost::type_erasure::param< Concept, T >::param ( const any< Concept, U > &  a,
typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< typename::boost::add_const< U >::type, T > >::type = 0 
)
inline
template<class Concept, class T>
template<class U >
boost::type_erasure::param< Concept, T >::param ( any< Concept, U > &&  a,
typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< U &&, T > >::type = 0 
)
inline

Member Function Documentation

template<class Concept, class T>
any<Concept, T> boost::type_erasure::param< Concept, T >::get ( ) const
inline

Returns the stored any.

Friends And Related Function Documentation

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

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