boost_no_cxx11_hdr_typeindex.ipp 851 B

123456789101112131415161718192021222324252627282930313233
  1. // (C) Copyright Beman Dawes 2009
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for more information.
  6. // MACRO: BOOST_NO_CXX11_HDR_TYPEINDEX
  7. // TITLE: C++0x header <typeindex> unavailable
  8. // DESCRIPTION: The standard library does not supply C++0x header <typeindex>
  9. #include <typeindex>
  10. namespace boost_no_cxx11_hdr_typeindex {
  11. int test()
  12. {
  13. #if defined( BOOST_NO_TYPEID )
  14. std::type_index * p1;
  15. std::hash<std::type_index> h;
  16. (void)p1;
  17. (void)h;
  18. return 0;
  19. #else
  20. std::type_index t1 = typeid(int);
  21. std::type_index t2 = typeid(double);
  22. std::hash<std::type_index> h;
  23. return (t1 != t2) && (h(t1) != h(t2)) ? 0 : 1;
  24. #endif
  25. }
  26. }