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)
11 #ifndef BOOST_TYPE_ERASURE_DEDUCED_HPP_INCLUDED
12 #define BOOST_TYPE_ERASURE_DEDUCED_HPP_INCLUDED
14 #include <boost/mpl/eval_if.hpp>
15 #include <boost/mpl/identity.hpp>
16 #include <boost/mpl/set.hpp>
17 #include <boost/mpl/empty.hpp>
18 #include <boost/type_erasure/detail/get_placeholders.hpp>
19 #include <boost/type_erasure/placeholder.hpp>
22 namespace type_erasure {
25 * A placeholder for an associated type. The type corresponding
26 * to this placeholder is deduced by substituting placeholders
27 * in the arguments of the metafunction and then evaluating it.
29 * When using @ref deduced in a template context, if it is possible for
30 * Metafunction to contain no placeholders at all, use the nested type,
31 * to automatically evaluate it early as needed.
33 template<class Metafunction>
34 struct deduced : ::boost::type_erasure::placeholder
36 typedef typename ::boost::mpl::eval_if<
38 typename ::boost::type_erasure::detail::get_placeholders<
44 ::boost::mpl::identity<
45 ::boost::type_erasure::deduced<Metafunction>