]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Make allocator equality comparable in tests
authorJonathan Wakely <jwakely@redhat.com>
Mon, 9 Aug 2021 10:36:07 +0000 (11:36 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 9 Aug 2021 10:43:50 +0000 (11:43 +0100)
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.

libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc
libstdc++-v3/testsuite/23_containers/unordered_set/cons/default.cc

index d64d078a7dab8cf459888710cfac0813250b9a50..7a785e980b1fc88f70ec988cef3efec1ea1ef11d 100644 (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>,
index 41281d3d774e440104db0eb6f57386744cfe429b..fb87c96ce9d4ed2fa63083cb3f911499637c2bb3 100644 (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>,