libstdc++: Make allocator equality comparable in tests

libstdc++-v3/ChangeLog:

	* testsuite/23_containers/unordered_map/cons/default.cc: Add
	equality comparison operators to allocator.
	* testsuite/23_containers/unordered_set/cons/default.cc:
	Likewise.
This commit is contained in:
Jonathan Wakely 2021-08-09 11:36:07 +01:00
parent 527a1cf32c
commit 2eff2a3cb5
2 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,9 @@ template<typename T>
void deallocate(T *p, std::size_t n)
{ std::allocator<T>().deallocate(p, n); }
bool operator==(const NoDefaultConsAlloc&) const { return true; }
bool operator!=(const NoDefaultConsAlloc&) const { return false; }
};
using Map = std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,

View File

@ -18,6 +18,9 @@ template<typename T>
void deallocate(T *p, std::size_t n)
{ std::allocator<T>().deallocate(p, n); }
bool operator==(const NoDefaultConsAlloc&) const { return true; }
bool operator!=(const NoDefaultConsAlloc&) const { return false; }
};
using Set = std::unordered_set<int, std::hash<int>, std::equal_to<int>,