From ccd40d0c44e2d19e3b452aa9b266837489159961 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 11 Oct 2022 15:20:13 -0700 Subject: [PATCH] Update fancy pointer's implementation of `pointer_to` to support all types by using boost::addressof() --- test/objects/minimal.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/objects/minimal.hpp b/test/objects/minimal.hpp index f5298265..cb1fe9b0 100644 --- a/test/objects/minimal.hpp +++ b/test/objects/minimal.hpp @@ -11,6 +11,7 @@ #if !defined(BOOST_UNORDERED_OBJECTS_MINIMAL_HEADER) #define BOOST_UNORDERED_OBJECTS_MINIMAL_HEADER +#include #include #include #include @@ -320,7 +321,7 @@ namespace test { bool operator!() const { return !ptr_; } static ptr pointer_to(T& p) { - return ptr(&p); + return ptr(boost::addressof(p)); } // I'm not using the safe bool idiom because the containers should be