derived.hpp 927 B

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