1 // (C) Copyright John Maddock 2001.
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)
6 // See http://www.boost.org/libs/config for most recent version.
8 // MACRO: BOOST_HAS_HASH
9 // TITLE: <hashset> and <hashmap>
10 // DESCRIPTION: The C++ implementation provides the (SGI) hash_set
11 // or hash_map classes.
13 #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
14 # ifdef BOOST_NO_CXX11_STD_UNORDERED
15 # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
16 # define _BACKWARD_BACKWARD_WARNING_H 1 /* turn off warnings from the headers below */
17 # include <ext/hash_set>
18 # include <ext/hash_map>
20 // If we have BOOST_NO_CXX11_STD_UNORDERED *not* defined, then we must
21 // not include the <ext/*> headers as they clash with the C++0x
22 // headers. ie in any given translation unit we can include one
23 // or the other, but not both.
24 # define DISABLE_BOOST_HAS_HASH_TEST
31 #ifndef BOOST_STD_EXTENSION_NAMESPACE
32 #define BOOST_STD_EXTENSION_NAMESPACE std
35 namespace boost_has_hash{
37 #ifndef DISABLE_BOOST_HAS_HASH_TEST
39 template <class Key, class Eq, class Hash, class Alloc>
40 void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>& )
44 template <class Key, class T, class Eq, class Hash, class Alloc>
45 void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>& )
53 #ifndef DISABLE_BOOST_HAS_HASH_TEST
54 BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs;
56 BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm;