msvc_eti_base.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_MSVC_ETI_BASE_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_/is_msvc_eti_arg.hpp>
  14. #include <boost/mpl/aux_/config/eti.hpp>
  15. #include <boost/mpl/aux_/config/gcc.hpp>
  16. #include <boost/mpl/aux_/config/workaround.hpp>
  17. namespace boost { namespace mpl { namespace aux {
  18. #if defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG)
  19. template< bool > struct msvc_eti_base_impl
  20. {
  21. template< typename T > struct result_
  22. : T
  23. {
  24. typedef T type;
  25. };
  26. };
  27. template<> struct msvc_eti_base_impl<true>
  28. {
  29. template< typename T > struct result_
  30. {
  31. typedef result_ type;
  32. typedef result_ first;
  33. typedef result_ second;
  34. typedef result_ tag;
  35. enum { value = 0 };
  36. };
  37. };
  38. template< typename T > struct msvc_eti_base
  39. : msvc_eti_base_impl< is_msvc_eti_arg<T>::value >
  40. ::template result_<T>
  41. {
  42. };
  43. #else // !BOOST_MPL_CFG_MSVC_70_ETI_BUG
  44. template< typename T > struct msvc_eti_base
  45. : T
  46. {
  47. #if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304))
  48. msvc_eti_base();
  49. #endif
  50. typedef T type;
  51. };
  52. #endif
  53. template<> struct msvc_eti_base<int>
  54. {
  55. typedef msvc_eti_base type;
  56. typedef msvc_eti_base first;
  57. typedef msvc_eti_base second;
  58. typedef msvc_eti_base tag;
  59. enum { value = 0 };
  60. };
  61. }}}
  62. #endif // BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED