/Src/Dependencies/Boost/boost/multi_index/detail/prevent_eti.hpp

http://hadesmem.googlecode.com/ · C++ Header · 60 lines · 36 code · 13 blank · 11 comment · 0 complexity · de37469b33ac5504df5b2daef2a86c80 MD5 · raw file

  1. /* Copyright 2003-2008 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/multi_index for library home page.
  7. */
  8. #ifndef BOOST_MULTI_INDEX_DETAIL_PREVENT_ETI_HPP
  9. #define BOOST_MULTI_INDEX_DETAIL_PREVENT_ETI_HPP
  10. #if defined(_MSC_VER)&&(_MSC_VER>=1200)
  11. #pragma once
  12. #endif
  13. #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
  14. #include <boost/detail/workaround.hpp>
  15. #if BOOST_WORKAROUND(BOOST_MSVC,<1300)
  16. #include <boost/mpl/if.hpp>
  17. #include <boost/mpl/integral_c.hpp>
  18. #include <boost/mpl/aux_/msvc_never_true.hpp>
  19. #endif
  20. namespace boost{
  21. namespace multi_index{
  22. namespace detail{
  23. #if BOOST_WORKAROUND(BOOST_MSVC,<1300)
  24. /* See
  25. * http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_MPL
  26. * Item 5.6, Beware of the 'early template instantiation' trap.
  27. */
  28. template<typename Type,typename Construct>
  29. struct prevent_eti
  30. {
  31. typedef typename mpl::if_<
  32. mpl::aux::msvc_never_true<Type>,
  33. mpl::integral_c<int,0>,
  34. Construct
  35. >::type type;
  36. };
  37. #else
  38. template<typename Type,typename Construct>
  39. struct prevent_eti
  40. {
  41. typedef Construct type;
  42. };
  43. #endif
  44. } /* namespace multi_index::detail */
  45. } /* namespace multi_index */
  46. } /* namespace boost */
  47. #endif