diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp index 1c6aa99a..66c5897f 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -17,6 +17,7 @@ #include "../helpers/input_iterator.hpp" #include "../helpers/helpers.hpp" +#include #include namespace insert_tests { @@ -697,44 +698,65 @@ namespace insert_tests { { int x; - pointer_constructible() : x(-1) {} + pointer_constructible(int x_) : x(x_) {} pointer_constructible(pointer_constructible const& p) : x(p.x) {} - pointer_constructible(pointer_constructible* p) : x(p->x) {} + pointer_constructible(pointer_constructible* const&) : x(-1) {} + pointer_constructible(BOOST_RV_REF(pointer_constructible*)) : x(-2) {} }; - std::size_t hash_value(pointer_constructible const& p) + struct pointer_constructible_hash { - return boost::hash()(p.x); - } + typedef void is_transparent; - bool operator==( - pointer_constructible const& lhs, pointer_constructible const& rhs) - { - return lhs.x == rhs.x; - } + std::size_t operator()(pointer_constructible const& p) const + { + return boost::hash()(p.x); + } + }; - bool operator!=( - pointer_constructible const& lhs, pointer_constructible const& rhs) + struct pointer_constructible_equal_to { - return !(lhs == rhs); - } + typedef void is_transparent; + + bool operator()( + pointer_constructible const& lhs, pointer_constructible const& rhs) const + { + return lhs.x == rhs.x; + } + }; template