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