Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:32:54

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_TYPEID_OF_HPP_INCLUDED
0012 #define BOOST_TYPE_ERASURE_TYPEID_OF_HPP_INCLUDED
0013 
0014 #include <boost/type_traits/remove_cv.hpp>
0015 #include <boost/type_traits/remove_reference.hpp>
0016 #include <boost/type_erasure/detail/access.hpp>
0017 #include <boost/type_erasure/any.hpp>
0018 #include <boost/type_erasure/binding.hpp>
0019 
0020 namespace boost {
0021 namespace type_erasure {
0022 
0023 /**
0024  * The first form returns the type currently stored in an @ref any.
0025  *
0026  * The second form returns the type corresponding to a
0027  * placeholder in @c binding.
0028  *
0029  * \pre @c Concept includes @ref typeid_ "typeid_<T>".
0030  * \pre @c T is a non-reference, CV-unqualified @ref placeholder.
0031  */
0032 template<class Concept, class T>
0033 const std::type_info& typeid_of(const any<Concept, T>& arg)
0034 {
0035     return ::boost::type_erasure::detail::access::table(arg).template find<
0036         ::boost::type_erasure::typeid_<
0037             typename ::boost::remove_cv<
0038                 typename ::boost::remove_reference<T>::type
0039             >::type
0040         >
0041     >()();
0042 }
0043 
0044 #ifndef BOOST_TYPE_ERASURE_DOXYGEN
0045 template<class Concept, class T>
0046 const std::type_info& typeid_of(const param<Concept, T>& arg)
0047 {
0048     return ::boost::type_erasure::detail::access::table(arg).template find<
0049         ::boost::type_erasure::typeid_<
0050             typename ::boost::remove_cv<
0051                 typename ::boost::remove_reference<T>::type
0052             >::type
0053         >
0054     >()();
0055 }
0056 #endif
0057 
0058 /**
0059  * \overload
0060  */
0061 template<class T, class Concept>
0062 const std::type_info& typeid_of(const binding<Concept>& binding_arg)
0063 {
0064     return binding_arg.template find< ::boost::type_erasure::typeid_<T> >()();
0065 }
0066 
0067 }
0068 }
0069 
0070 #endif