• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)
5
6//  See http://www.boost.org/libs/config for most recent version.
7
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.
12
13#include BOOST_HASH_SET_HEADER
14#include BOOST_HASH_MAP_HEADER
15
16#ifndef BOOST_STD_EXTENSION_NAMESPACE
17#define BOOST_STD_EXTENSION_NAMESPACE std
18#endif
19
20namespace boost_has_hash{
21
22#ifndef DISABLE_BOOST_HAS_HASH_TEST
23
24template <class Key, class Eq, class Hash, class Alloc>
25void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>& )
26{
27}
28
29template <class Key, class Eq, class Hash, class Alloc>
30void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<Key,Eq,Hash,Alloc>& )
31{
32}
33
34template <class Key, class T, class Eq, class Hash, class Alloc>
35void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>& )
36{
37}
38
39#endif
40
41int test()
42{
43#ifndef DISABLE_BOOST_HAS_HASH_TEST
44   BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs;
45   hs.insert(2);
46   foo(hs);
47   BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm;
48   hm[3] = 2;
49   foo(hm);
50   BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<int> hs2;
51   hs2.insert(2);
52   hs2.insert(2);
53   foo(hs2);
54#endif
55   return 0;
56}
57
58}
59
60
61
62
63
64
65