Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:10:13

0001 // Boost.TypeErasure library
0002 //
0003 // Copyright 2011 Steven Watanabe
0004 //
0005 // Distributed under the Boost Software License Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // $Id$
0010 
0011 #ifndef BOOST_TYPE_ERASURE_DEDUCED_HPP_INCLUDED
0012 #define BOOST_TYPE_ERASURE_DEDUCED_HPP_INCLUDED
0013 
0014 #include <boost/mpl/eval_if.hpp>
0015 #include <boost/mpl/identity.hpp>
0016 #include <boost/mpl/set.hpp>
0017 #include <boost/mpl/empty.hpp>
0018 #include <boost/type_erasure/detail/get_placeholders.hpp>
0019 #include <boost/type_erasure/placeholder.hpp>
0020 
0021 namespace boost {
0022 namespace type_erasure {
0023 
0024 /**
0025  * A placeholder for an associated type.  The type corresponding
0026  * to this placeholder is deduced by substituting placeholders
0027  * in the arguments of the metafunction and then evaluating it.
0028  * 
0029  * When using @ref deduced in a template context, if it is possible for
0030  * Metafunction to contain no placeholders at all, use the nested type,
0031  * to automatically evaluate it early as needed.
0032  */
0033 template<class Metafunction>
0034 struct deduced : ::boost::type_erasure::placeholder
0035 {
0036     typedef typename ::boost::mpl::eval_if<
0037         ::boost::mpl::empty<
0038             typename ::boost::type_erasure::detail::get_placeholders<
0039                 Metafunction,
0040 #ifndef BOOST_TYPE_ERASURE_USE_MP11
0041                 ::boost::mpl::set0<>
0042 #else
0043                 ::boost::mp11::mp_list<>
0044 #endif
0045             >::type
0046         >,
0047         Metafunction,
0048         ::boost::mpl::identity<
0049             ::boost::type_erasure::deduced<Metafunction>
0050         >
0051     >::type type;
0052 };
0053 
0054 }
0055 }
0056 
0057 #endif