is_msvc_eti_arg.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef BOOST_MPL_AUX_IS_MSVC_ETI_ARG_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_IS_MSVC_ETI_ARG_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_/yes_no.hpp>
  14. #include <boost/mpl/aux_/config/eti.hpp>
  15. #include <boost/mpl/aux_/config/static_constant.hpp>
  16. namespace boost { namespace mpl { namespace aux {
  17. #if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
  18. #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
  19. template< typename T >
  20. struct is_msvc_eti_arg
  21. {
  22. BOOST_STATIC_CONSTANT(bool, value = false);
  23. };
  24. #else // BOOST_MPL_CFG_MSVC_60_ETI_BUG
  25. struct eti_int_convertible
  26. {
  27. eti_int_convertible(int);
  28. };
  29. template< typename T >
  30. struct is_msvc_eti_arg
  31. {
  32. static no_tag test(...);
  33. static yes_tag test(eti_int_convertible);
  34. static T& get();
  35. BOOST_STATIC_CONSTANT(bool, value =
  36. sizeof(test(get())) == sizeof(yes_tag)
  37. );
  38. };
  39. #endif
  40. template<>
  41. struct is_msvc_eti_arg<int>
  42. {
  43. BOOST_STATIC_CONSTANT(bool, value = true);
  44. };
  45. #endif // BOOST_MPL_CFG_MSVC_ETI_BUG
  46. }}}
  47. #endif // BOOST_MPL_AUX_IS_MSVC_ETI_ARG_HPP_INCLUDED