summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libadhocutil/lazyPointer.h4
-rw-r--r--libadhocutil/unittests/Jamfile.jam12
2 files changed, 16 insertions, 0 deletions
diff --git a/libadhocutil/lazyPointer.h b/libadhocutil/lazyPointer.h
index 70fe61d..8b523d3 100644
--- a/libadhocutil/lazyPointer.h
+++ b/libadhocutil/lazyPointer.h
@@ -58,7 +58,11 @@ namespace AdHoc {
[[nodiscard]] T *
get() const
{
+#if __cpp_lib_to_address
+ return std::to_address(deref());
+#else
return &*deref();
+#endif
}
[[nodiscard]] const P &
diff --git a/libadhocutil/unittests/Jamfile.jam b/libadhocutil/unittests/Jamfile.jam
index f91579a..5ca476d 100644
--- a/libadhocutil/unittests/Jamfile.jam
+++ b/libadhocutil/unittests/Jamfile.jam
@@ -161,6 +161,18 @@ run
;
run
+ testLazyPointer.cpp
+ : : :
+ <define>BOOST_TEST_DYN_LINK
+ <library>..//adhocutil
+ <library>boost_utf
+ <cxxstd>17
+ -<cxxstd>20
+ :
+ testLazyPointer17
+ ;
+
+run
testNvpParse.cpp
: : :
<define>BOOST_TEST_DYN_LINK