00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _TR1_UNORDERED_SET
00035 #define _TR1_UNORDERED_SET 1
00036
00037 #include <tr1/hashtable>
00038 #include <tr1/functional_hash.h>
00039
00040 namespace std
00041 {
00042 _GLIBCXX_BEGIN_NAMESPACE(tr1)
00043
00044
00045
00046 template<class _Value,
00047 class _Hash = hash<_Value>,
00048 class _Pred = std::equal_to<_Value>,
00049 class _Alloc = std::allocator<_Value>,
00050 bool __cache_hash_code = false>
00051 class unordered_set
00052 : public _Hashtable<_Value, _Value, _Alloc,
00053 std::_Identity<_Value>, _Pred,
00054 _Hash, __detail::_Mod_range_hashing,
00055 __detail::_Default_ranged_hash,
00056 __detail::_Prime_rehash_policy,
00057 __cache_hash_code, true, true>
00058 {
00059 typedef _Hashtable<_Value, _Value, _Alloc,
00060 std::_Identity<_Value>, _Pred,
00061 _Hash, __detail::_Mod_range_hashing,
00062 __detail::_Default_ranged_hash,
00063 __detail::_Prime_rehash_policy,
00064 __cache_hash_code, true, true>
00065 _Base;
00066
00067 public:
00068 typedef typename _Base::size_type size_type;
00069 typedef typename _Base::hasher hasher;
00070 typedef typename _Base::key_equal key_equal;
00071 typedef typename _Base::allocator_type allocator_type;
00072
00073 explicit
00074 unordered_set(size_type __n = 10,
00075 const hasher& __hf = hasher(),
00076 const key_equal& __eql = key_equal(),
00077 const allocator_type& __a = allocator_type())
00078 : _Base(__n, __hf, __detail::_Mod_range_hashing(),
00079 __detail::_Default_ranged_hash(), __eql,
00080 std::_Identity<_Value>(), __a)
00081 { }
00082
00083 template<typename _InputIterator>
00084 unordered_set(_InputIterator __f, _InputIterator __l,
00085 size_type __n = 10,
00086 const hasher& __hf = hasher(),
00087 const key_equal& __eql = key_equal(),
00088 const allocator_type& __a = allocator_type())
00089 : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
00090 __detail::_Default_ranged_hash(), __eql,
00091 std::_Identity<_Value>(), __a)
00092 { }
00093 };
00094
00095 template<class _Value,
00096 class _Hash = hash<_Value>,
00097 class _Pred = std::equal_to<_Value>,
00098 class _Alloc = std::allocator<_Value>,
00099 bool __cache_hash_code = false>
00100 class unordered_multiset
00101 : public _Hashtable<_Value, _Value, _Alloc,
00102 std::_Identity<_Value>, _Pred,
00103 _Hash, __detail::_Mod_range_hashing,
00104 __detail::_Default_ranged_hash,
00105 __detail::_Prime_rehash_policy,
00106 __cache_hash_code, true, false>
00107 {
00108 typedef _Hashtable<_Value, _Value, _Alloc,
00109 std::_Identity<_Value>, _Pred,
00110 _Hash, __detail::_Mod_range_hashing,
00111 __detail::_Default_ranged_hash,
00112 __detail::_Prime_rehash_policy,
00113 __cache_hash_code, true, false>
00114 _Base;
00115
00116 public:
00117 typedef typename _Base::size_type size_type;
00118 typedef typename _Base::hasher hasher;
00119 typedef typename _Base::key_equal key_equal;
00120 typedef typename _Base::allocator_type allocator_type;
00121
00122 explicit
00123 unordered_multiset(size_type __n = 10,
00124 const hasher& __hf = hasher(),
00125 const key_equal& __eql = key_equal(),
00126 const allocator_type& __a = allocator_type())
00127 : _Base(__n, __hf, __detail::_Mod_range_hashing(),
00128 __detail::_Default_ranged_hash(), __eql,
00129 std::_Identity<_Value>(), __a)
00130 { }
00131
00132
00133 template<typename _InputIterator>
00134 unordered_multiset(_InputIterator __f, _InputIterator __l,
00135 typename _Base::size_type __n = 0,
00136 const hasher& __hf = hasher(),
00137 const key_equal& __eql = key_equal(),
00138 const allocator_type& __a = allocator_type())
00139 : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
00140 __detail::_Default_ranged_hash(), __eql,
00141 std::_Identity<_Value>(), __a)
00142 { }
00143 };
00144
00145 template<class _Value, class _Hash, class _Pred, class _Alloc,
00146 bool __cache_hash_code>
00147 inline void
00148 swap (unordered_set<_Value, _Hash, _Pred,
00149 _Alloc, __cache_hash_code>& __x,
00150 unordered_set<_Value, _Hash, _Pred,
00151 _Alloc, __cache_hash_code>& __y)
00152 { __x.swap(__y); }
00153
00154 template<class _Value, class _Hash, class _Pred, class _Alloc,
00155 bool __cache_hash_code>
00156 inline void
00157 swap(unordered_multiset<_Value, _Hash, _Pred,
00158 _Alloc, __cache_hash_code>& __x,
00159 unordered_multiset<_Value, _Hash, _Pred,
00160 _Alloc, __cache_hash_code>& __y)
00161 { __x.swap(__y); }
00162
00163 _GLIBCXX_END_NAMESPACE
00164 }
00165
00166 #endif // _TR1_UNORDERED_SET