1
// Boost.TypeErasure library
3
// Copyright 2011 Steven Watanabe
5
// Distributed under the Boost Software License Version 1.0. (See
6
// accompanying file LICENSE_1_0.txt or copy at
7
// http://www.boost.org/LICENSE_1_0.txt)
9
// $Id: rebind_any.hpp 81428 2012-11-19 21:19:34Z steven_watanabe $
11
#ifndef BOOST_TYPE_ERASURE_REBIND_ANY_HPP_INCLUDED
12
#define BOOST_TYPE_ERASURE_REBIND_ANY_HPP_INCLUDED
14
#include <boost/mpl/if.hpp>
15
#include <boost/type_traits/remove_cv.hpp>
16
#include <boost/type_traits/remove_reference.hpp>
17
#include <boost/type_erasure/is_placeholder.hpp>
18
#include <boost/type_erasure/concept_of.hpp>
21
namespace type_erasure {
23
template<class Concept, class T>
27
* A metafunction that changes the @ref placeholder of
28
* an @ref any. If @c T is not a placeholder,
29
* returns @c T unchanged. This class is intended
30
* to be used in @ref concept_interface to deduce
31
* the argument types from the arguments of the concept.
33
* @pre Any must be a specialization of @ref any or a base
34
* class of such a specialization.
37
* rebind_any<any<Concept>, _a>::type -> any<Concept, _a>
38
* rebind_any<any<Concept>, _b&>::type -> any<Concept, _b&>
39
* rebind_any<any<Concept>, int>::type -> int
42
* @see derived, as_param
44
template<class Any, class T>
47
#ifdef BOOST_TYPE_ERASURE_DOXYGEN
48
typedef detail::unspecified type;
50
typedef typename ::boost::mpl::if_<
51
::boost::type_erasure::is_placeholder<
52
typename ::boost::remove_cv<
53
typename ::boost::remove_reference<T>::type
56
::boost::type_erasure::any<
57
typename ::boost::type_erasure::concept_of<Any>::type,