type_wrapper.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2000-2004
  4. // Copyright Peter Dimov 2000-2003
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/aux_/config/ctps.hpp>
  15. namespace boost { namespace mpl { namespace aux {
  16. template< typename T > struct type_wrapper
  17. {
  18. typedef T type;
  19. };
  20. #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
  21. // agurt 08/may/03: a complicated way to extract the wrapped type; need it
  22. // mostly for the sake of GCC (3.2.x), which ICEs if you try to extract the
  23. // nested 'type' from 'type_wrapper<T>' when the latter was the result of a
  24. // 'typeof' expression
  25. template< typename T > struct wrapped_type;
  26. template< typename T > struct wrapped_type< type_wrapper<T> >
  27. {
  28. typedef T type;
  29. };
  30. #else
  31. template< typename W > struct wrapped_type
  32. {
  33. typedef typename W::type type;
  34. };
  35. #endif
  36. }}}
  37. #endif // BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED