From 4f141646b5dbf523c368eb9a9a1d1a6a3a6bf45b Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sun, 19 May 2019 23:48:11 -0400 Subject: [PATCH] Add overloads for non-const lvalue reference --- include/boost/core/empty_value.hpp | 8 ++++++++ include/boost/core/noinit_adaptor.hpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/include/boost/core/empty_value.hpp b/include/boost/core/empty_value.hpp index 9265f05..7139b3e 100644 --- a/include/boost/core/empty_value.hpp +++ b/include/boost/core/empty_value.hpp @@ -71,6 +71,10 @@ public: template empty_value(boost::empty_init_t, const U& value) : value_(value) { } + + template + empty_value(boost::empty_init_t, U& value) + : value_(value) { } #endif const T& get() const BOOST_NOEXCEPT { @@ -115,6 +119,10 @@ public: template empty_value(boost::empty_init_t, const U& value) : T(value) { } + + template + empty_value(boost::empty_init_t, U& value) + : T(value) { } #endif const T& get() const BOOST_NOEXCEPT { diff --git a/include/boost/core/noinit_adaptor.hpp b/include/boost/core/noinit_adaptor.hpp index 26fa7c3..22c9aab 100644 --- a/include/boost/core/noinit_adaptor.hpp +++ b/include/boost/core/noinit_adaptor.hpp @@ -71,6 +71,11 @@ struct noinit_adaptor void construct(U* p, const V& v) { ::new((void*)p) U(v); } + + template + void construct(U* p, V& v) { + ::new((void*)p) U(v); + } #endif template