mirror of
https://github.com/boostorg/unordered.git
synced 2025-11-15 14:59:32 +01:00
Merge unordered and hash.
Improved Codegear support in unordered. Another warning suppression in hash. [SVN r58223]
This commit is contained in:
@@ -288,6 +288,9 @@ namespace boost { namespace unordered_detail {
|
||||
{
|
||||
if (node_) {
|
||||
if (value_constructed_) {
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { hash_node<Alloc, Grouped> x; };
|
||||
#endif
|
||||
boost::unordered_detail::destroy(&node_->value());
|
||||
}
|
||||
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
template <class K, class T, class H, class P, class A>
|
||||
class unordered_map
|
||||
{
|
||||
public:
|
||||
typedef Key key_type;
|
||||
typedef std::pair<const Key, T> value_type;
|
||||
typedef K key_type;
|
||||
typedef std::pair<const K, T> value_type;
|
||||
typedef T mapped_type;
|
||||
typedef Hash hasher;
|
||||
typedef Pred key_equal;
|
||||
typedef Alloc allocator_type;
|
||||
typedef H hasher;
|
||||
typedef P key_equal;
|
||||
typedef A allocator_type;
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
private:
|
||||
@@ -58,7 +58,7 @@ namespace boost
|
||||
allocator_type, value_type>::type
|
||||
value_allocator;
|
||||
|
||||
typedef boost::unordered_detail::map<Key, Hash, Pred,
|
||||
typedef boost::unordered_detail::map<K, H, P,
|
||||
value_allocator> types;
|
||||
typedef BOOST_DEDUCED_TYPENAME types::impl table;
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace boost
|
||||
}
|
||||
#else
|
||||
unordered_map(boost::unordered_detail::move_from<
|
||||
unordered_map<Key, T, Hash, Pred, Alloc>
|
||||
unordered_map<K, T, H, P, A>
|
||||
> other)
|
||||
: table_(other.source.table_, boost::unordered_detail::move_tag())
|
||||
{
|
||||
@@ -284,6 +284,7 @@ namespace boost
|
||||
}
|
||||
#else
|
||||
|
||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||
std::pair<iterator, bool> emplace(value_type const& v = value_type())
|
||||
{
|
||||
return boost::unordered_detail::pair_cast<iterator, bool>(
|
||||
@@ -294,6 +295,7 @@ namespace boost
|
||||
{
|
||||
return iterator(table_.emplace(v).first);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||
template < \
|
||||
@@ -511,9 +513,9 @@ namespace boost
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
friend bool operator==<Key, T, Hash, Pred, Alloc>(
|
||||
friend bool operator==<K, T, H, P, A>(
|
||||
unordered_map const&, unordered_map const&);
|
||||
friend bool operator!=<Key, T, Hash, Pred, Alloc>(
|
||||
friend bool operator!=<K, T, H, P, A>(
|
||||
unordered_map const&, unordered_map const&);
|
||||
#endif
|
||||
}; // class template unordered_map
|
||||
@@ -522,6 +524,9 @@ namespace boost
|
||||
inline bool operator==(unordered_map<K, T, H, P, A> const& m1,
|
||||
unordered_map<K, T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_map<K,T,H,P,A> x; };
|
||||
#endif
|
||||
return m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -529,6 +534,9 @@ namespace boost
|
||||
inline bool operator!=(unordered_map<K, T, H, P, A> const& m1,
|
||||
unordered_map<K, T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_map<K,T,H,P,A> x; };
|
||||
#endif
|
||||
return !m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -536,20 +544,23 @@ namespace boost
|
||||
inline void swap(unordered_map<K, T, H, P, A> &m1,
|
||||
unordered_map<K, T, H, P, A> &m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_map<K,T,H,P,A> x; };
|
||||
#endif
|
||||
m1.swap(m2);
|
||||
}
|
||||
|
||||
template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
template <class K, class T, class H, class P, class A>
|
||||
class unordered_multimap
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Key key_type;
|
||||
typedef std::pair<const Key, T> value_type;
|
||||
typedef K key_type;
|
||||
typedef std::pair<const K, T> value_type;
|
||||
typedef T mapped_type;
|
||||
typedef Hash hasher;
|
||||
typedef Pred key_equal;
|
||||
typedef Alloc allocator_type;
|
||||
typedef H hasher;
|
||||
typedef P key_equal;
|
||||
typedef A allocator_type;
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
private:
|
||||
@@ -560,7 +571,7 @@ namespace boost
|
||||
allocator_type, value_type>::type
|
||||
value_allocator;
|
||||
|
||||
typedef boost::unordered_detail::multimap<Key, Hash, Pred,
|
||||
typedef boost::unordered_detail::multimap<K, H, P,
|
||||
value_allocator> types;
|
||||
typedef BOOST_DEDUCED_TYPENAME types::impl table;
|
||||
|
||||
@@ -680,7 +691,7 @@ namespace boost
|
||||
}
|
||||
#else
|
||||
unordered_multimap(boost::unordered_detail::move_from<
|
||||
unordered_multimap<Key, T, Hash, Pred, Alloc>
|
||||
unordered_multimap<K, T, H, P, A>
|
||||
> other)
|
||||
: table_(other.source.table_, boost::unordered_detail::move_tag())
|
||||
{
|
||||
@@ -786,6 +797,7 @@ namespace boost
|
||||
}
|
||||
#else
|
||||
|
||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||
iterator emplace(value_type const& v = value_type())
|
||||
{
|
||||
return iterator(table_.emplace(v));
|
||||
@@ -796,7 +808,7 @@ namespace boost
|
||||
{
|
||||
return iterator(table_.emplace(v));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||
template < \
|
||||
@@ -999,9 +1011,9 @@ namespace boost
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
friend bool operator==<Key, T, Hash, Pred, Alloc>(
|
||||
friend bool operator==<K, T, H, P, A>(
|
||||
unordered_multimap const&, unordered_multimap const&);
|
||||
friend bool operator!=<Key, T, Hash, Pred, Alloc>(
|
||||
friend bool operator!=<K, T, H, P, A>(
|
||||
unordered_multimap const&, unordered_multimap const&);
|
||||
#endif
|
||||
}; // class template unordered_multimap
|
||||
@@ -1010,6 +1022,9 @@ namespace boost
|
||||
inline bool operator==(unordered_multimap<K, T, H, P, A> const& m1,
|
||||
unordered_multimap<K, T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_multimap<K,T,H,P,A> x; };
|
||||
#endif
|
||||
return m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -1017,6 +1032,9 @@ namespace boost
|
||||
inline bool operator!=(unordered_multimap<K, T, H, P, A> const& m1,
|
||||
unordered_multimap<K, T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_multimap<K,T,H,P,A> x; };
|
||||
#endif
|
||||
return !m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -1024,6 +1042,9 @@ namespace boost
|
||||
inline void swap(unordered_multimap<K, T, H, P, A> &m1,
|
||||
unordered_multimap<K, T, H, P, A> &m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_multimap<K,T,H,P,A> x; };
|
||||
#endif
|
||||
m1.swap(m2);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class Key,
|
||||
template <class K,
|
||||
class T,
|
||||
class Hash = hash<Key>,
|
||||
class Pred = std::equal_to<Key>,
|
||||
class Alloc = std::allocator<std::pair<const Key, T> > >
|
||||
class H = hash<K>,
|
||||
class P = std::equal_to<K>,
|
||||
class A = std::allocator<std::pair<const K, T> > >
|
||||
class unordered_map;
|
||||
template <class K, class T, class H, class P, class A>
|
||||
bool operator==(unordered_map<K, T, H, P, A> const&,
|
||||
@@ -33,11 +33,11 @@ namespace boost
|
||||
void swap(unordered_map<K, T, H, P, A>&,
|
||||
unordered_map<K, T, H, P, A>&);
|
||||
|
||||
template <class Key,
|
||||
template <class K,
|
||||
class T,
|
||||
class Hash = hash<Key>,
|
||||
class Pred = std::equal_to<Key>,
|
||||
class Alloc = std::allocator<std::pair<const Key, T> > >
|
||||
class H = hash<K>,
|
||||
class P = std::equal_to<K>,
|
||||
class A = std::allocator<std::pair<const K, T> > >
|
||||
class unordered_multimap;
|
||||
template <class K, class T, class H, class P, class A>
|
||||
bool operator==(unordered_multimap<K, T, H, P, A> const&,
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class Value, class Hash, class Pred, class Alloc>
|
||||
template <class T, class H, class P, class A>
|
||||
class unordered_set
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Value key_type;
|
||||
typedef Value value_type;
|
||||
typedef Hash hasher;
|
||||
typedef Pred key_equal;
|
||||
typedef Alloc allocator_type;
|
||||
typedef T key_type;
|
||||
typedef T value_type;
|
||||
typedef H hasher;
|
||||
typedef P key_equal;
|
||||
typedef A allocator_type;
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
private:
|
||||
@@ -58,7 +58,7 @@ namespace boost
|
||||
allocator_type, value_type>::type
|
||||
value_allocator;
|
||||
|
||||
typedef boost::unordered_detail::set<Hash, Pred,
|
||||
typedef boost::unordered_detail::set<H, P,
|
||||
value_allocator> types;
|
||||
typedef BOOST_DEDUCED_TYPENAME types::impl table;
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace boost
|
||||
}
|
||||
#else
|
||||
unordered_set(boost::unordered_detail::move_from<
|
||||
unordered_set<Value, Hash, Pred, Alloc>
|
||||
unordered_set<T, H, P, A>
|
||||
> other)
|
||||
: table_(other.source.table_, boost::unordered_detail::move_tag())
|
||||
{
|
||||
@@ -478,9 +478,9 @@ namespace boost
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
friend bool operator==<Value, Hash, Pred, Alloc>(
|
||||
friend bool operator==<T, H, P, A>(
|
||||
unordered_set const&, unordered_set const&);
|
||||
friend bool operator!=<Value, Hash, Pred, Alloc>(
|
||||
friend bool operator!=<T, H, P, A>(
|
||||
unordered_set const&, unordered_set const&);
|
||||
#endif
|
||||
}; // class template unordered_set
|
||||
@@ -489,6 +489,9 @@ namespace boost
|
||||
inline bool operator==(unordered_set<T, H, P, A> const& m1,
|
||||
unordered_set<T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_set<T,H,P,A> x; };
|
||||
#endif
|
||||
return m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -496,6 +499,9 @@ namespace boost
|
||||
inline bool operator!=(unordered_set<T, H, P, A> const& m1,
|
||||
unordered_set<T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_set<T,H,P,A> x; };
|
||||
#endif
|
||||
return !m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -503,19 +509,22 @@ namespace boost
|
||||
inline void swap(unordered_set<T, H, P, A> &m1,
|
||||
unordered_set<T, H, P, A> &m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_set<T,H,P,A> x; };
|
||||
#endif
|
||||
m1.swap(m2);
|
||||
}
|
||||
|
||||
template <class Value, class Hash, class Pred, class Alloc>
|
||||
template <class T, class H, class P, class A>
|
||||
class unordered_multiset
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Value key_type;
|
||||
typedef Value value_type;
|
||||
typedef Hash hasher;
|
||||
typedef Pred key_equal;
|
||||
typedef Alloc allocator_type;
|
||||
typedef T key_type;
|
||||
typedef T value_type;
|
||||
typedef H hasher;
|
||||
typedef P key_equal;
|
||||
typedef A allocator_type;
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
private:
|
||||
@@ -526,7 +535,7 @@ namespace boost
|
||||
allocator_type, value_type>::type
|
||||
value_allocator;
|
||||
|
||||
typedef boost::unordered_detail::multiset<Hash, Pred,
|
||||
typedef boost::unordered_detail::multiset<H, P,
|
||||
value_allocator> types;
|
||||
typedef BOOST_DEDUCED_TYPENAME types::impl table;
|
||||
|
||||
@@ -640,7 +649,7 @@ namespace boost
|
||||
}
|
||||
#else
|
||||
unordered_multiset(boost::unordered_detail::move_from<
|
||||
unordered_multiset<Value, Hash, Pred, Alloc>
|
||||
unordered_multiset<T, H, P, A>
|
||||
> other)
|
||||
: table_(other.source.table_, boost::unordered_detail::move_tag())
|
||||
{
|
||||
@@ -943,9 +952,9 @@ namespace boost
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
||||
friend bool operator==<Value, Hash, Pred, Alloc>(
|
||||
friend bool operator==<T, H, P, A>(
|
||||
unordered_multiset const&, unordered_multiset const&);
|
||||
friend bool operator!=<Value, Hash, Pred, Alloc>(
|
||||
friend bool operator!=<T, H, P, A>(
|
||||
unordered_multiset const&, unordered_multiset const&);
|
||||
#endif
|
||||
}; // class template unordered_multiset
|
||||
@@ -954,6 +963,9 @@ namespace boost
|
||||
inline bool operator==(unordered_multiset<T, H, P, A> const& m1,
|
||||
unordered_multiset<T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_multiset<T,H,P,A> x; };
|
||||
#endif
|
||||
return m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -961,6 +973,9 @@ namespace boost
|
||||
inline bool operator!=(unordered_multiset<T, H, P, A> const& m1,
|
||||
unordered_multiset<T, H, P, A> const& m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_multiset<T,H,P,A> x; };
|
||||
#endif
|
||||
return !m1.table_.equals(m2.table_);
|
||||
}
|
||||
|
||||
@@ -968,6 +983,9 @@ namespace boost
|
||||
inline void swap(unordered_multiset<T, H, P, A> &m1,
|
||||
unordered_multiset<T, H, P, A> &m2)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
||||
struct dummy { unordered_multiset<T,H,P,A> x; };
|
||||
#endif
|
||||
m1.swap(m2);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class Value,
|
||||
class Hash = hash<Value>,
|
||||
class Pred = std::equal_to<Value>,
|
||||
class Alloc = std::allocator<Value> >
|
||||
template <class T,
|
||||
class H = hash<T>,
|
||||
class P = std::equal_to<T>,
|
||||
class A = std::allocator<T> >
|
||||
class unordered_set;
|
||||
template <class T, class H, class P, class A>
|
||||
bool operator==(unordered_set<T, H, P, A> const&,
|
||||
@@ -32,10 +32,10 @@ namespace boost
|
||||
void swap(unordered_set<T, H, P, A> &m1,
|
||||
unordered_set<T, H, P, A> &m2);
|
||||
|
||||
template <class Value,
|
||||
class Hash = hash<Value>,
|
||||
class Pred = std::equal_to<Value>,
|
||||
class Alloc = std::allocator<Value> >
|
||||
template <class T,
|
||||
class H = hash<T>,
|
||||
class P = std::equal_to<T>,
|
||||
class A = std::allocator<T> >
|
||||
class unordered_multiset;
|
||||
template <class T, class H, class P, class A>
|
||||
bool operator==(unordered_multiset<T, H, P, A> const&,
|
||||
|
||||
Reference in New Issue
Block a user