From 81a995269534d47dde009510c9f2e1c913b7ce38 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 17 Jan 2024 03:57:53 +0200 Subject: [PATCH] Remove BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS workarounds --- include/boost/system/detail/error_code.hpp | 19 ------------------- .../boost/system/detail/error_condition.hpp | 19 ------------------- 2 files changed, 38 deletions(-) diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index 2b387fb..b8833b3 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -335,30 +335,11 @@ public: } } -#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error { return failed(); } -#else - - typedef void (*unspecified_bool_type)(); - static void unspecified_bool_true() {} - - BOOST_SYSTEM_CONSTEXPR operator unspecified_bool_type() const BOOST_NOEXCEPT // true if error - { - return failed()? unspecified_bool_true: 0; - } - - BOOST_SYSTEM_CONSTEXPR bool operator!() const BOOST_NOEXCEPT // true if no error - { - return !failed(); - } - -#endif - bool has_location() const BOOST_NOEXCEPT { return lc_flags_ >= 4; diff --git a/include/boost/system/detail/error_condition.hpp b/include/boost/system/detail/error_condition.hpp index b2da281..a53b4d9 100644 --- a/include/boost/system/detail/error_condition.hpp +++ b/include/boost/system/detail/error_condition.hpp @@ -158,30 +158,11 @@ public: } } -#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error { return failed(); } -#else - - typedef void (*unspecified_bool_type)(); - static void unspecified_bool_true() {} - - BOOST_SYSTEM_CONSTEXPR operator unspecified_bool_type() const BOOST_NOEXCEPT // true if error - { - return failed()? unspecified_bool_true: 0; - } - - BOOST_SYSTEM_CONSTEXPR bool operator!() const BOOST_NOEXCEPT // true if no error - { - return !failed(); - } - -#endif - // relationals: // the more symmetrical non-member syntax allows enum // conversions work for both rhs and lhs.