From f99decc0ca3dff124bf895b51ac1f33334a9e0fd Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Fri, 6 Jan 2023 12:13:52 -0800 Subject: [PATCH] Add unordered_node_set to the insert_tests --- test/helpers/unordered.hpp | 1 + test/unordered/insert_tests.cpp | 63 +++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/test/helpers/unordered.hpp b/test/helpers/unordered.hpp index ab9ed1dc..d3cbf17f 100644 --- a/test/helpers/unordered.hpp +++ b/test/helpers/unordered.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #else #include diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp index 99f5a175..d2b9b62a 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -693,6 +693,50 @@ namespace insert_tests { BOOST_TEST_EQ(x.size(), 1000u); } + struct pointer_constructible + { + int x; + + pointer_constructible() : x(-1) {} + pointer_constructible(pointer_constructible const& p) : x(p.x) {} + pointer_constructible(pointer_constructible* p) : x(p->x) {} + }; + + std::size_t hash_value(pointer_constructible const& p) + { + return boost::hash()(p.x); + } + + bool operator==( + pointer_constructible const& lhs, pointer_constructible const& rhs) + { + return lhs.x == rhs.x; + } + + bool operator!=( + pointer_constructible const& lhs, pointer_constructible const& rhs) + { + return !(lhs == rhs); + } + + template