From e9f5ed41be7139fdaf62e928e75156cdc1cf09d9 Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Tue, 13 May 2014 14:11:17 +0200 Subject: [PATCH] binding to rvalues can be reenabled with a macro --- include/boost/optional/optional.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 72f5ab9..57fa522 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -175,9 +175,11 @@ struct types_when_is_ref template void prevent_binding_rvalue_ref_to_optional_lvalue_ref() { +#ifndef BOOST_OPTIONAL_ALLOW_BINDING_TO_RVALUES BOOST_STATIC_ASSERT_MSG( !boost::is_lvalue_reference::value || !boost::is_rvalue_reference::value, - "binding rvalue references to optional lvalue references is disallowed"); + "binding rvalue references to optional lvalue references is disallowed"); +#endif } struct optional_tag {} ;