All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hash_set.h
Go to the documentation of this file.
1 /* hash_set.h
2  */
3 #ifndef HASH_SET_H
4 #define HASH_SET_H
5 
6 #include "osl/stl/hash.h"
8 #if (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)
9 # include <tr1/unordered_set>
10 #else
11 # include <boost/unordered_set.hpp>
12 #endif
13 #include <cstddef>
14 namespace osl
15 {
16  namespace stl
17  {
18 #if (__GNUC__ >= 4 && __GNUC_MINOR__ >=3)
19  template<class Value, class HashFun=osl::stl::hash<Value>,
20  class Equal=std::equal_to<Value> >
21  struct hash_set
22  : public std::tr1::unordered_set<Value, HashFun, Equal, pool_allocator<Value> >
23  {
24  typedef std::tr1::unordered_set<Value, HashFun, Equal, pool_allocator<Value> > base_t;
25  hash_set() {}
26  hash_set(size_t s) : base_t(s)
27  {
28  }
29  };
30 #else
31  template<class Value, class HashFun=osl::stl::hash<Value>,
32  class Equal=std::equal_to<Value> >
33  struct hash_set
34  : public boost::unordered_set<Value, HashFun, Equal, pool_allocator<Value> >
35  {
36  typedef boost::unordered_set<Value, HashFun, Equal, pool_allocator<Value> > base_t;
37  hash_set() {}
38  hash_set(size_t s) : base_t(s)
39  {
40  }
41  };
42 #endif
43  } // namespace stl
44  using stl::hash_set;
45 } // namespace stl
46 
47 #endif /* HASH_SET_H */
48 // ;;; Local Variables:
49 // ;;; mode:c++
50 // ;;; c-basic-offset:2
51 // ;;; End: