From f2e1db8021ac03bde88028a95b99581922bb664f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 26 Jul 2022 21:49:13 +0300 Subject: [PATCH] Constrain explicit value and error constructors to not accept zero arguments. Fixes #86. --- 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 8ff55fb..4e6c00c 100644 --- a/include/boost/system/result.hpp +++ b/include/boost/system/result.hpp @@ -135,7 +135,8 @@ public: template::value && !(detail::is_errc_t::value && std::is_arithmetic::value) && - !std::is_constructible::value + !std::is_constructible::value && + sizeof...(A) >= 1 >::type> explicit constexpr result( A&&... a ) noexcept( std::is_nothrow_constructible::value ) @@ -146,7 +147,8 @@ public: // explicit, error template::value && - std::is_constructible::value + std::is_constructible::value && + sizeof...(A) >= 1 >::type> explicit constexpr result( A&&... a ) noexcept( std::is_nothrow_constructible::value )