From 8ce2a9f83527cf60adc75a89d6d63ce9933404c5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 22 Jan 2023 01:22:02 +0200 Subject: [PATCH] Disable result converting constructor when T is convertible from the rhs result. Refs #104. --- include/boost/system/result.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/system/result.hpp b/include/boost/system/result.hpp index 33eec39..8479b36 100644 --- a/include/boost/system/result.hpp +++ b/include/boost/system/result.hpp @@ -187,7 +187,8 @@ public: // converting template::value && - std::is_convertible::value + std::is_convertible::value && + !std::is_convertible const&, T>::value >::type> BOOST_CXX14_CONSTEXPR result( result const& r2 ) noexcept( @@ -205,7 +206,8 @@ public: template::value && - std::is_convertible::value + std::is_convertible::value && + !std::is_convertible&&, T>::value >::type> BOOST_CXX14_CONSTEXPR result( result&& r2 ) noexcept(