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_DERIVED_HPP_INCLUDED 12 #define BOOST_TYPE_ERASURE_DERIVED_HPP_INCLUDED 13 14 namespace boost { 15 namespace type_erasure { 16 17 /** 18 * A metafunction which returns the full @ref any type, 19 * when given any of its base classes. This is primarily 20 * intended to be used when implementing @ref concept_interface. 21 * 22 * \see rebind_any, as_param 23 */ 24 template<class T> 25 struct derived 26 { 27 #ifdef BOOST_TYPE_ERASURE_DOXYGEN 28 typedef detail::unspecified type; 29 #else 30 typedef typename T::_boost_type_erasure_derived_type type; 31 #endif 32 }; 33 34 #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES 35 36 template<class T> 37 using derived_t = typename T::_boost_type_erasure_derived_type; 38 39 #endif 40 41 } 42 } 43 44 #endif 45