msvc_type.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef BOOST_MPL_AUX_MSVC_TYPE_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_MSVC_TYPE_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2001-2004
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/mpl for documentation.
  10. // $Id$
  11. // $Date$
  12. // $Revision$
  13. #include <boost/mpl/aux_/config/eti.hpp>
  14. #include <boost/mpl/aux_/is_msvc_eti_arg.hpp>
  15. namespace boost { namespace mpl { namespace aux {
  16. #if defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG)
  17. template< bool > struct msvc_type_impl
  18. {
  19. template< typename T > struct result_
  20. {
  21. typedef typename T::type type;
  22. };
  23. };
  24. template<> struct msvc_type_impl<true>
  25. {
  26. template< typename T > struct result_
  27. {
  28. typedef result_ type;
  29. };
  30. };
  31. template< typename T > struct msvc_type
  32. : msvc_type_impl< is_msvc_eti_arg<T>::value >
  33. ::template result_<T>
  34. {
  35. };
  36. #else // BOOST_MPL_CFG_MSVC_70_ETI_BUG
  37. template< typename T > struct msvc_type
  38. {
  39. typedef typename T::type type;
  40. };
  41. template<> struct msvc_type<int>
  42. {
  43. typedef int type;
  44. };
  45. #endif
  46. }}}
  47. #endif // BOOST_MPL_AUX_MSVC_TYPE_HPP_INCLUDED