mirror of
https://github.com/boostorg/unordered.git
synced 2025-10-11 06:55:25 +02:00
Update test Hash, KeyEqual to be nothrow swappable
This commit is contained in:
@@ -227,8 +227,21 @@ namespace test {
|
||||
}
|
||||
return x1.tag_ != x2.tag_;
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_FOA_TESTS)
|
||||
friend void swap(hash&, hash&) noexcept;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_UNORDERED_FOA_TESTS)
|
||||
void swap(hash& lhs, hash& rhs) noexcept
|
||||
{
|
||||
int tag = lhs.tag_;
|
||||
lhs.tag_ = rhs.tag_;
|
||||
rhs.tag_ = tag;
|
||||
}
|
||||
#endif
|
||||
|
||||
class less
|
||||
{
|
||||
int tag_;
|
||||
@@ -364,8 +377,20 @@ namespace test {
|
||||
}
|
||||
|
||||
friend less create_compare(equal_to x) { return less(x.tag_); }
|
||||
#if defined(BOOST_UNORDERED_FOA_TESTS)
|
||||
friend void swap(equal_to&, equal_to&) noexcept;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_UNORDERED_FOA_TESTS)
|
||||
void swap(equal_to& lhs, equal_to& rhs) noexcept
|
||||
{
|
||||
int tag = lhs.tag_;
|
||||
lhs.tag_ = rhs.tag_;
|
||||
rhs.tag_ = tag;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T> class allocator
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user