// Boost.TypeErasure library // // Copyright 2011 Steven Watanabe // // Distributed under the Boost Software License Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // $Id$ #ifndef BOOST_TYPE_ERASURE_TYPEID_OF_HPP_INCLUDED #define BOOST_TYPE_ERASURE_TYPEID_OF_HPP_INCLUDED #include #include #include #include #include namespace boost { namespace type_erasure { /** * The first form returns the type currently stored in an @ref any. * * The second form returns the type corresponding to a * placeholder in @c binding. * * \pre @c Concept includes @ref typeid_ "typeid_". * \pre @c T is a non-reference, CV-unqualified @ref placeholder. */ template const std::type_info& typeid_of(const any& arg) { return ::boost::type_erasure::detail::access::table(arg).template find< ::boost::type_erasure::typeid_< typename ::boost::remove_cv< typename ::boost::remove_reference::type >::type > >()(); } #ifndef BOOST_TYPE_ERASURE_DOXYGEN template const std::type_info& typeid_of(const param& arg) { return ::boost::type_erasure::detail::access::table(arg).template find< ::boost::type_erasure::typeid_< typename ::boost::remove_cv< typename ::boost::remove_reference::type >::type > >()(); } #endif /** * \overload */ template const std::type_info& typeid_of(const binding& binding_arg) { return binding_arg.template find< ::boost::type_erasure::typeid_ >()(); } } } #endif