1 // Boost.TypeErasure library
2 //
3 // Copyright 2011 Steven Watanabe
4 //
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)
8 //
9 // $Id$
10 
11 #ifndef BOOST_TYPE_ERASURE_PLACEHOLDER_OF_HPP_INCLUDED
12 #define BOOST_TYPE_ERASURE_PLACEHOLDER_OF_HPP_INCLUDED
13 
14 namespace boost {
15 namespace type_erasure {
16 
17 #ifndef BOOST_TYPE_ERASURE_DOXYGEN
18 
19 template<class Concept, class T>
20 class any;
21 
22 template<class Concept, class T>
23 class param;
24 
25 #endif
26 
27 /**
28  * A metafunction returning the (const/reference qualified) placeholder
29  * corresponding  to an @ref any.  It will also work for all bases
30  * of @ref any, so it can be applied to the @c Base
31  * parameter of @ref concept_interface.
32  */
33 template<class T>
34 struct placeholder_of
35 {
36 #ifdef BOOST_TYPE_ERASURE_DOXYGEN
37     typedef detail::unspecified type;
38 #else
39     typedef typename ::boost::type_erasure::placeholder_of<
40         typename T::_boost_type_erasure_derived_type
41     >::type type;
42 #endif
43 };
44 
45 /** INTERNAL ONLY */
46 template<class Concept, class T>
47 struct placeholder_of< ::boost::type_erasure::any<Concept, T> >
48 {
49     typedef T type;
50 };
51 
52 /** INTERNAL ONLY */
53 template<class Concept, class T>
54 struct placeholder_of< ::boost::type_erasure::param<Concept, T> >
55 {
56     typedef T type;
57 };
58 
59 #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
60 
61 template<class T>
62 using placeholder_of_t = typename ::boost::type_erasure::placeholder_of<T>::type;
63 
64 #endif
65 
66 }
67 }
68 
69 #endif
70