diff --git a/lslboost/boost/assert.hpp b/lslboost/boost/assert.hpp index b644a888a..40d147ef7 100644 --- a/lslboost/boost/assert.hpp +++ b/lslboost/boost/assert.hpp @@ -46,7 +46,13 @@ namespace lslboost { +#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN) + BOOST_NORETURN +#endif void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined +#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN) + BOOST_NORETURN +#endif void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined } // namespace lslboost diff --git a/lslboost/boost/config/assert_cxx17.hpp b/lslboost/boost/config/assert_cxx17.hpp index ffa1ae918..e2402515f 100644 --- a/lslboost/boost/config/assert_cxx17.hpp +++ b/lslboost/boost/config/assert_cxx17.hpp @@ -12,6 +12,9 @@ #include #include +#ifdef BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +# error "Your compiler appears not to be fully C++17 compliant. Detected via defect macro BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS." +#endif #ifdef BOOST_NO_CXX17_DEDUCTION_GUIDES # error "Your compiler appears not to be fully C++17 compliant. Detected via defect macro BOOST_NO_CXX17_DEDUCTION_GUIDES." #endif diff --git a/lslboost/boost/config/compiler/borland.hpp b/lslboost/boost/config/compiler/borland.hpp index 567636c5b..51d518869 100644 --- a/lslboost/boost/config/compiler/borland.hpp +++ b/lslboost/boost/config/compiler/borland.hpp @@ -245,6 +245,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #if __BORLANDC__ >= 0x590 # define BOOST_HAS_TR1_HASH diff --git a/lslboost/boost/config/compiler/clang.hpp b/lslboost/boost/config/compiler/clang.hpp index 1eeed315d..f9a5050b4 100644 --- a/lslboost/boost/config/compiler/clang.hpp +++ b/lslboost/boost/config/compiler/clang.hpp @@ -321,6 +321,10 @@ # define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif +#if (__clang_major__ < 4) || (__cplusplus < 201406L) /* non-standard value that is greater than 201402, which is reported by clang 4.0.0 for C++1z */ +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + #if __cplusplus < 201103L #define BOOST_NO_CXX11_SFINAE_EXPR #endif diff --git a/lslboost/boost/config/compiler/codegear.hpp b/lslboost/boost/config/compiler/codegear.hpp index 4d3f42aef..49f934c02 100644 --- a/lslboost/boost/config/compiler/codegear.hpp +++ b/lslboost/boost/config/compiler/codegear.hpp @@ -316,6 +316,10 @@ # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + // // TR1 macros: // diff --git a/lslboost/boost/config/compiler/common_edg.hpp b/lslboost/boost/config/compiler/common_edg.hpp index dc049893c..0d59ae0e6 100644 --- a/lslboost/boost/config/compiler/common_edg.hpp +++ b/lslboost/boost/config/compiler/common_edg.hpp @@ -171,10 +171,12 @@ #if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) # define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif - #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #ifdef c_plusplus // EDG has "long long" in non-strict mode diff --git a/lslboost/boost/config/compiler/digitalmars.hpp b/lslboost/boost/config/compiler/digitalmars.hpp index bb56ff6c0..4fa347ab8 100644 --- a/lslboost/boost/config/compiler/digitalmars.hpp +++ b/lslboost/boost/config/compiler/digitalmars.hpp @@ -130,6 +130,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #if (__DMC__ <= 0x840) #error "Compiler not supported or configured - please reconfigure" diff --git a/lslboost/boost/config/compiler/gcc.hpp b/lslboost/boost/config/compiler/gcc.hpp index 2f1fe5508..fc05a9186 100644 --- a/lslboost/boost/config/compiler/gcc.hpp +++ b/lslboost/boost/config/compiler/gcc.hpp @@ -319,6 +319,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if (__GNUC__ < 7) || (__cplusplus < 201703L) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #if __GNUC__ >= 7 # define BOOST_FALLTHROUGH __attribute__((fallthrough)) diff --git a/lslboost/boost/config/compiler/gcc_xml.hpp b/lslboost/boost/config/compiler/gcc_xml.hpp index 75cac44e9..e23b14d0f 100644 --- a/lslboost/boost/config/compiler/gcc_xml.hpp +++ b/lslboost/boost/config/compiler/gcc_xml.hpp @@ -108,7 +108,8 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__ - - diff --git a/lslboost/boost/config/compiler/hp_acc.hpp b/lslboost/boost/config/compiler/hp_acc.hpp index 25636324b..42e35e553 100644 --- a/lslboost/boost/config/compiler/hp_acc.hpp +++ b/lslboost/boost/config/compiler/hp_acc.hpp @@ -137,6 +137,10 @@ #define BOOST_NO_CXX11_VARIADIC_MACROS #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + #endif // diff --git a/lslboost/boost/config/compiler/metrowerks.hpp b/lslboost/boost/config/compiler/metrowerks.hpp index 448ab67bc..c38efb321 100644 --- a/lslboost/boost/config/compiler/metrowerks.hpp +++ b/lslboost/boost/config/compiler/metrowerks.hpp @@ -173,6 +173,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) diff --git a/lslboost/boost/config/compiler/mpw.hpp b/lslboost/boost/config/compiler/mpw.hpp index 8433f3719..3adb61221 100644 --- a/lslboost/boost/config/compiler/mpw.hpp +++ b/lslboost/boost/config/compiler/mpw.hpp @@ -122,6 +122,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif // // versions check: diff --git a/lslboost/boost/config/compiler/nvcc.hpp b/lslboost/boost/config/compiler/nvcc.hpp index 419dd724a..147f75dbf 100644 --- a/lslboost/boost/config/compiler/nvcc.hpp +++ b/lslboost/boost/config/compiler/nvcc.hpp @@ -57,5 +57,8 @@ # define BOOST_NO_CXX11_NOEXCEPT #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS #endif +#endif diff --git a/lslboost/boost/config/compiler/pathscale.hpp b/lslboost/boost/config/compiler/pathscale.hpp index 5348cf7f7..59ab9b007 100644 --- a/lslboost/boost/config/compiler/pathscale.hpp +++ b/lslboost/boost/config/compiler/pathscale.hpp @@ -135,4 +135,7 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #endif diff --git a/lslboost/boost/config/compiler/sunpro_cc.hpp b/lslboost/boost/config/compiler/sunpro_cc.hpp index 490dc76dc..334b604bb 100644 --- a/lslboost/boost/config/compiler/sunpro_cc.hpp +++ b/lslboost/boost/config/compiler/sunpro_cc.hpp @@ -194,6 +194,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif // Turn on threading support for Solaris 12. // Ticket #11972 diff --git a/lslboost/boost/config/compiler/vacpp.hpp b/lslboost/boost/config/compiler/vacpp.hpp index 9cfa1adf8..3794d3601 100644 --- a/lslboost/boost/config/compiler/vacpp.hpp +++ b/lslboost/boost/config/compiler/vacpp.hpp @@ -184,3 +184,6 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif diff --git a/lslboost/boost/config/compiler/visualc.hpp b/lslboost/boost/config/compiler/visualc.hpp index c0ada098a..ce0fc15e3 100644 --- a/lslboost/boost/config/compiler/visualc.hpp +++ b/lslboost/boost/config/compiler/visualc.hpp @@ -263,6 +263,9 @@ #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif +#if (_MSC_VER < 1914) || (_MSVC_LANG < 201703) +#define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif // // Things that don't work in clr mode: diff --git a/lslboost/boost/config/compiler/xlcpp.hpp b/lslboost/boost/config/compiler/xlcpp.hpp index 99b8b2455..4a4477d9d 100644 --- a/lslboost/boost/config/compiler/xlcpp.hpp +++ b/lslboost/boost/config/compiler/xlcpp.hpp @@ -265,6 +265,10 @@ # define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + #if !__has_feature(cxx_thread_local) # define BOOST_NO_CXX11_THREAD_LOCAL #endif diff --git a/lslboost/boost/config/compiler/xlcpp_zos.hpp b/lslboost/boost/config/compiler/xlcpp_zos.hpp index 9a177f1bb..0b288a880 100644 --- a/lslboost/boost/config/compiler/xlcpp_zos.hpp +++ b/lslboost/boost/config/compiler/xlcpp_zos.hpp @@ -157,6 +157,7 @@ #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS #define BOOST_NO_CXX17_IF_CONSTEXPR +#define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS // ------------------------------------- diff --git a/lslboost/boost/config/detail/cxx_composite.hpp b/lslboost/boost/config/detail/cxx_composite.hpp index 9c2c01ead..acd8e8496 100644 --- a/lslboost/boost/config/detail/cxx_composite.hpp +++ b/lslboost/boost/config/detail/cxx_composite.hpp @@ -164,6 +164,7 @@ #endif #if defined(BOOST_NO_CXX14)\ + || defined(BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS)\ || defined(BOOST_NO_CXX17_DEDUCTION_GUIDES)\ || defined(BOOST_NO_CXX17_FOLD_EXPRESSIONS)\ || defined(BOOST_NO_CXX17_HDR_ANY)\ diff --git a/lslboost/boost/config/stdlib/libcpp.hpp b/lslboost/boost/config/stdlib/libcpp.hpp index 0e9f2445e..777228fad 100644 --- a/lslboost/boost/config/stdlib/libcpp.hpp +++ b/lslboost/boost/config/stdlib/libcpp.hpp @@ -177,4 +177,9 @@ #endif #endif +#if _LIBCPP_VERSION <= 170006 +// no std::ranges::join_view +# define BOOST_NO_CXX20_HDR_RANGES +#endif + // --- end --- diff --git a/lslboost/boost/smart_ptr/detail/operator_bool.hpp b/lslboost/boost/smart_ptr/detail/operator_bool.hpp deleted file mode 100644 index f9c5ef680..000000000 --- a/lslboost/boost/smart_ptr/detail/operator_bool.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// This header intentionally has no include guards. -// -// Copyright (c) 2001-2009, 2012 Peter Dimov -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt - -#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR )\ - && !(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5130)) - - explicit operator bool () const BOOST_SP_NOEXCEPT - { - return px != 0; - } - -#elif ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, < 0x570) ) || defined(__CINT__) - - operator bool () const BOOST_SP_NOEXCEPT - { - return px != 0; - } - -#elif defined( _MANAGED ) - - static void unspecified_bool( this_type*** ) - { - } - - typedef void (*unspecified_bool_type)( this_type*** ); - - operator unspecified_bool_type() const BOOST_SP_NOEXCEPT - { - return px == 0? 0: unspecified_bool; - } - -#elif \ - ( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \ - ( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) ) || \ - ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) ) - - typedef element_type * (this_type::*unspecified_bool_type)() const; - - operator unspecified_bool_type() const BOOST_SP_NOEXCEPT - { - return px == 0? 0: &this_type::get; - } - -#else - - typedef element_type * this_type::*unspecified_bool_type; - - operator unspecified_bool_type() const BOOST_SP_NOEXCEPT - { - return px == 0? 0: &this_type::px; - } - -#endif - - // operator! is redundant, but some compilers need it - bool operator! () const BOOST_SP_NOEXCEPT - { - return px == 0; - } diff --git a/lslboost/boost/smart_ptr/detail/requires_cxx11.hpp b/lslboost/boost/smart_ptr/detail/requires_cxx11.hpp deleted file mode 100644 index fd719c877..000000000 --- a/lslboost/boost/smart_ptr/detail/requires_cxx11.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED -#define BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED - -// Copyright 2023 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include -#include - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ - defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ - defined(BOOST_NO_CXX11_DECLTYPE) || \ - defined(BOOST_NO_CXX11_CONSTEXPR) || \ - defined(BOOST_NO_CXX11_NOEXCEPT) || \ - defined(BOOST_NO_CXX11_NULLPTR) || \ - defined(BOOST_NO_CXX11_SMART_PTR) - -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.85.") - -#endif - -#endif // #ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED diff --git a/lslboost/boost/smart_ptr/detail/sp_convertible.hpp b/lslboost/boost/smart_ptr/detail/sp_convertible.hpp index 8e67d2317..c257d040b 100644 --- a/lslboost/boost/smart_ptr/detail/sp_convertible.hpp +++ b/lslboost/boost/smart_ptr/detail/sp_convertible.hpp @@ -18,20 +18,6 @@ #include #include -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_BORLANDC ) && ( BOOST_BORLANDC < 0x630 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - namespace lslboost { @@ -87,6 +73,4 @@ template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_i } // namespace lslboost -#endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED diff --git a/lslboost/boost/smart_ptr/detail/sp_cxx20_constexpr.hpp b/lslboost/boost/smart_ptr/detail/sp_cxx20_constexpr.hpp new file mode 100644 index 000000000..dc7c9ca15 --- /dev/null +++ b/lslboost/boost/smart_ptr/detail/sp_cxx20_constexpr.hpp @@ -0,0 +1,37 @@ +#ifndef BOOST_SMART_PTR_DETAIL_SP_CXX20_CONSTEXPR_HPP_INCLUDED +#define BOOST_SMART_PTR_DETAIL_SP_CXX20_CONSTEXPR_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +// detail/sp_noexcept.hpp +// +// Copyright 2025 Mathias Stearn +// +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + + +// This macro is used to mark functions as constexpr if the compiler supports +// constexpr destructors. Since you can't have a constexpr smart pointer object, +// everything except null constructors are guided behind this macro. Because +// this also guards a use of dynamic_cast, we need to check for its availability +// as well. It isn't worth splitting out since all known compilers that support +// constexpr dynamic_cast also support constexpr destructors. +// +// WARNING: This does not check for changing active member of a union in +// constant expressions which is allowed in C++20. If that is needed, we +// need to raise the checked version to 202002L. +#if defined(__cpp_constexpr_dynamic_alloc) && __cpp_constexpr_dynamic_alloc >= 201907L \ + && defined(__cpp_constexpr) && __cpp_constexpr >= 201907L +#define BOOST_SP_CXX20_CONSTEXPR constexpr +#else +#define BOOST_SP_CXX20_CONSTEXPR +#define BOOST_SP_NO_CXX20_CONSTEXPR +#endif + +#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_CXX20_CONSTEXPR_HPP_INCLUDED diff --git a/lslboost/boost/smart_ptr/detail/sp_noexcept.hpp b/lslboost/boost/smart_ptr/detail/sp_noexcept.hpp index 1287ba495..3b0d04ed5 100644 --- a/lslboost/boost/smart_ptr/detail/sp_noexcept.hpp +++ b/lslboost/boost/smart_ptr/detail/sp_noexcept.hpp @@ -15,25 +15,16 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include -// BOOST_SP_NOEXCEPT +// BOOST_SP_NOEXCEPT (obsolete, only retained for compatibility) -#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1700 && BOOST_MSVC < 1900 +#define BOOST_SP_NOEXCEPT noexcept -# define BOOST_SP_NOEXCEPT BOOST_NOEXCEPT_OR_NOTHROW - -#else - -# define BOOST_SP_NOEXCEPT BOOST_NOEXCEPT - -#endif - -// BOOST_SP_NOEXCEPT_WITH_ASSERT +// BOOST_SP_NOEXCEPT_WITH_ASSERT (noexcept, unless a user assertion handler is present) #if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) ) -# define BOOST_SP_NOEXCEPT_WITH_ASSERT BOOST_SP_NOEXCEPT +# define BOOST_SP_NOEXCEPT_WITH_ASSERT noexcept #elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) ) @@ -41,7 +32,7 @@ #else -# define BOOST_SP_NOEXCEPT_WITH_ASSERT BOOST_SP_NOEXCEPT +# define BOOST_SP_NOEXCEPT_WITH_ASSERT noexcept #endif diff --git a/lslboost/boost/smart_ptr/detail/sp_nullptr_t.hpp b/lslboost/boost/smart_ptr/detail/sp_nullptr_t.hpp deleted file mode 100644 index 5b5194bf7..000000000 --- a/lslboost/boost/smart_ptr/detail/sp_nullptr_t.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED -#define BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// detail/sp_nullptr_t.hpp -// -// Copyright 2013 Peter Dimov -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt - -#include -#include - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -namespace lslboost -{ - -namespace detail -{ - -#if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) ) - - typedef decltype(nullptr) sp_nullptr_t; - -#else - - typedef std::nullptr_t sp_nullptr_t; - -#endif - -} // namespace detail - -} // namespace lslboost - -#endif // !defined( BOOST_NO_CXX11_NULLPTR ) - -#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED diff --git a/lslboost/boost/smart_ptr/intrusive_ptr.hpp b/lslboost/boost/smart_ptr/intrusive_ptr.hpp index be0fe3e83..6e0a1ef91 100644 --- a/lslboost/boost/smart_ptr/intrusive_ptr.hpp +++ b/lslboost/boost/smart_ptr/intrusive_ptr.hpp @@ -13,26 +13,14 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include - -#include - -#include -#include +#include #include -#include #include +#include -#include // for std::less - -#if !defined(BOOST_NO_IOSTREAM) -#if !defined(BOOST_NO_IOSFWD) +#include // for std::less #include // for std::basic_ostream -#else -#include -#endif -#endif - +#include namespace lslboost { @@ -62,64 +50,46 @@ template class intrusive_ptr typedef T element_type; - BOOST_CONSTEXPR intrusive_ptr() BOOST_SP_NOEXCEPT : px( 0 ) + constexpr intrusive_ptr() noexcept : px( 0 ) { } - intrusive_ptr( T * p, bool add_ref = true ): px( p ) + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr( T * p, bool add_ref = true ): px( p ) { if( px != 0 && add_ref ) intrusive_ptr_add_ref( px ); } -#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) - template -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - - intrusive_ptr( intrusive_ptr const & rhs, typename lslboost::detail::sp_enable_if_convertible::type = lslboost::detail::sp_empty() ) - -#else - - intrusive_ptr( intrusive_ptr const & rhs ) - -#endif + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr( intrusive_ptr const & rhs, typename lslboost::detail::sp_enable_if_convertible::type = lslboost::detail::sp_empty() ) : px( rhs.get() ) { if( px != 0 ) intrusive_ptr_add_ref( px ); } -#endif - - intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px ) + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px ) { if( px != 0 ) intrusive_ptr_add_ref( px ); } - ~intrusive_ptr() + BOOST_SP_CXX20_CONSTEXPR ~intrusive_ptr() { if( px != 0 ) intrusive_ptr_release( px ); } -#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) - - template intrusive_ptr & operator=(intrusive_ptr const & rhs) + template BOOST_SP_CXX20_CONSTEXPR intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } -#endif - // Move support -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px ) + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr(intrusive_ptr && rhs) noexcept : px( rhs.px ) { rhs.px = 0; } - intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr & operator=(intrusive_ptr && rhs) noexcept { this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); return *this; @@ -128,84 +98,76 @@ template class intrusive_ptr template friend class intrusive_ptr; template -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - - intrusive_ptr(intrusive_ptr && rhs, typename lslboost::detail::sp_enable_if_convertible::type = lslboost::detail::sp_empty()) - -#else - - intrusive_ptr(intrusive_ptr && rhs) - -#endif + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr(intrusive_ptr && rhs, typename lslboost::detail::sp_enable_if_convertible::type = lslboost::detail::sp_empty()) : px( rhs.px ) { rhs.px = 0; } template - intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr & operator=(intrusive_ptr && rhs) noexcept { this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); return *this; } -#endif - - intrusive_ptr & operator=(intrusive_ptr const & rhs) + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } - intrusive_ptr & operator=(T * rhs) + BOOST_SP_CXX20_CONSTEXPR intrusive_ptr & operator=(T * rhs) { this_type(rhs).swap(*this); return *this; } - void reset() + BOOST_SP_CXX20_CONSTEXPR void reset() { this_type().swap( *this ); } - void reset( T * rhs ) + BOOST_SP_CXX20_CONSTEXPR void reset( T * rhs ) { this_type( rhs ).swap( *this ); } - void reset( T * rhs, bool add_ref ) + BOOST_SP_CXX20_CONSTEXPR void reset( T * rhs, bool add_ref ) { this_type( rhs, add_ref ).swap( *this ); } - T * get() const BOOST_SP_NOEXCEPT + BOOST_SP_CXX20_CONSTEXPR T * get() const noexcept { return px; } - T * detach() BOOST_SP_NOEXCEPT + BOOST_SP_CXX20_CONSTEXPR T * detach() noexcept { T * ret = px; px = 0; return ret; } - T & operator*() const BOOST_SP_NOEXCEPT_WITH_ASSERT + BOOST_SP_CXX20_CONSTEXPR T & operator*() const BOOST_SP_NOEXCEPT_WITH_ASSERT { BOOST_ASSERT( px != 0 ); return *px; } - T * operator->() const BOOST_SP_NOEXCEPT_WITH_ASSERT + BOOST_SP_CXX20_CONSTEXPR T * operator->() const BOOST_SP_NOEXCEPT_WITH_ASSERT { BOOST_ASSERT( px != 0 ); return px; } -// implicit conversion to "bool" -#include + BOOST_SP_CXX20_CONSTEXPR explicit operator bool () const noexcept + { + return px != 0; + } - void swap(intrusive_ptr & rhs) BOOST_SP_NOEXCEPT + BOOST_SP_CXX20_CONSTEXPR void swap(intrusive_ptr & rhs) noexcept { T * tmp = px; px = rhs.px; @@ -217,118 +179,101 @@ template class intrusive_ptr T * px; }; -template inline bool operator==(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator==(intrusive_ptr const & a, intrusive_ptr const & b) noexcept { return a.get() == b.get(); } -template inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) noexcept { return a.get() != b.get(); } -template inline bool operator==(intrusive_ptr const & a, U * b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator==(intrusive_ptr const & a, U * b) noexcept { return a.get() == b; } -template inline bool operator!=(intrusive_ptr const & a, U * b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator!=(intrusive_ptr const & a, U * b) noexcept { return a.get() != b; } -template inline bool operator==(T * a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator==(T * a, intrusive_ptr const & b) noexcept { return a == b.get(); } -template inline bool operator!=(T * a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator!=(T * a, intrusive_ptr const & b) noexcept { return a != b.get(); } -#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ <= 96 - -// Resolve the ambiguity between our op!= and the one in rel_ops - -template inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT -{ - return a.get() != b.get(); -} - -#endif - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( intrusive_ptr const & p, lslboost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator==( intrusive_ptr const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template inline bool operator==( lslboost::detail::sp_nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator==( std::nullptr_t, intrusive_ptr const & p ) noexcept { return p.get() == 0; } -template inline bool operator!=( intrusive_ptr const & p, lslboost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator!=( intrusive_ptr const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template inline bool operator!=( lslboost::detail::sp_nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator!=( std::nullptr_t, intrusive_ptr const & p ) noexcept { return p.get() != 0; } -#endif - -template inline bool operator<(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline bool operator<(intrusive_ptr const & a, intrusive_ptr const & b) noexcept { return std::less()(a.get(), b.get()); } -template void swap(intrusive_ptr & lhs, intrusive_ptr & rhs) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline void swap(intrusive_ptr & lhs, intrusive_ptr & rhs) noexcept { lhs.swap(rhs); } // mem_fn support -template T * get_pointer(intrusive_ptr const & p) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline T * get_pointer(intrusive_ptr const & p) noexcept { return p.get(); } // pointer casts -template intrusive_ptr static_pointer_cast(intrusive_ptr const & p) +template BOOST_SP_CXX20_CONSTEXPR inline intrusive_ptr static_pointer_cast(intrusive_ptr const & p) { return static_cast(p.get()); } -template intrusive_ptr const_pointer_cast(intrusive_ptr const & p) +template BOOST_SP_CXX20_CONSTEXPR inline intrusive_ptr const_pointer_cast(intrusive_ptr const & p) { return const_cast(p.get()); } -template intrusive_ptr dynamic_pointer_cast(intrusive_ptr const & p) +template BOOST_SP_CXX20_CONSTEXPR inline intrusive_ptr dynamic_pointer_cast(intrusive_ptr const & p) { return dynamic_cast(p.get()); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -template intrusive_ptr static_pointer_cast( intrusive_ptr && p ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline intrusive_ptr static_pointer_cast( intrusive_ptr && p ) noexcept { return intrusive_ptr( static_cast( p.detach() ), false ); } -template intrusive_ptr const_pointer_cast( intrusive_ptr && p ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline intrusive_ptr const_pointer_cast( intrusive_ptr && p ) noexcept { return intrusive_ptr( const_cast( p.detach() ), false ); } -template intrusive_ptr dynamic_pointer_cast( intrusive_ptr && p ) BOOST_SP_NOEXCEPT +template BOOST_SP_CXX20_CONSTEXPR inline intrusive_ptr dynamic_pointer_cast( intrusive_ptr && p ) noexcept { T * p2 = dynamic_cast( p.get() ); @@ -339,48 +284,19 @@ template intrusive_ptr dynamic_pointer_cast( intrusive_ptr< return r; } -#endif // defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // operator<< -#if !defined(BOOST_NO_IOSTREAM) - -#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) ) - -template std::ostream & operator<< (std::ostream & os, intrusive_ptr const & p) -{ - os << p.get(); - return os; -} - -#else - -// in STLport's no-iostreams mode no iostream symbols can be used -#ifndef _STLP_NO_IOSTREAMS - -# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT) -// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL -using std::basic_ostream; -template basic_ostream & operator<< (basic_ostream & os, intrusive_ptr const & p) -# else template std::basic_ostream & operator<< (std::basic_ostream & os, intrusive_ptr const & p) -# endif { os << p.get(); return os; } -#endif // _STLP_NO_IOSTREAMS - -#endif // __GNUC__ < 3 - -#endif // !defined(BOOST_NO_IOSTREAM) - // hash_value template< class T > struct hash; -template< class T > std::size_t hash_value( lslboost::intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template< class T > std::size_t hash_value( lslboost::intrusive_ptr const & p ) noexcept { return lslboost::hash< T* >()( p.get() ); } @@ -389,14 +305,12 @@ template< class T > std::size_t hash_value( lslboost::intrusive_ptr const & p // std::hash -#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - namespace std { template struct hash< ::lslboost::intrusive_ptr > { - std::size_t operator()( ::lslboost::intrusive_ptr const & p ) const BOOST_SP_NOEXCEPT + std::size_t operator()( ::lslboost::intrusive_ptr const & p ) const noexcept { return std::hash< T* >()( p.get() ); } @@ -404,6 +318,4 @@ template struct hash< ::lslboost::intrusive_ptr > } // namespace std -#endif // #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - #endif // #ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED diff --git a/lslboost/boost/version.hpp b/lslboost/boost/version.hpp index 6cd7e9aa3..7b9876448 100644 --- a/lslboost/boost/version.hpp +++ b/lslboost/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 108400 +#define BOOST_VERSION 108900 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,6 +27,6 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by to select which library version to link to. -#define BOOST_LIB_VERSION "1_84" +#define BOOST_LIB_VERSION "1_89" #endif diff --git a/scripts/update_lslboost.sh b/scripts/update_lslboost.sh index 22e475d77..25cf54640 100755 --- a/scripts/update_lslboost.sh +++ b/scripts/update_lslboost.sh @@ -1,9 +1,9 @@ # the absolute path to the extracted boost source archive (https://www.boost.org/users/download/) set -e set -x -cd "$(dirname "$0")/.." -BOOSTPATH=/tmp/boost_1_84_0 +cd "$(dirname "$0")/.." +BOOSTPATH=/tmp/boost_1_89_0 TMPPATH=/tmp/lslboost # copy all needed boost files and rename all mentions of boost to lslboost @@ -14,4 +14,3 @@ rm -f $TMPPATH/Jamroot find $TMPPATH -type d -and \( -name build -o -name test -o -name edg -o -name dmc -o -name msvc?0 -o -name bcc* \) -print0 | xargs -0 rm -rf rsync -HAXavr --del $TMPPATH/boost lslboost - diff --git a/thirdparty/asio/asio.hpp b/thirdparty/asio/asio.hpp index a973ab178..2398b717f 100644 --- a/thirdparty/asio/asio.hpp +++ b/thirdparty/asio/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -28,7 +28,6 @@ #include "asio/async_result.hpp" #include "asio/awaitable.hpp" #include "asio/basic_datagram_socket.hpp" -#include "asio/basic_deadline_timer.hpp" #include "asio/basic_file.hpp" #include "asio/basic_io_object.hpp" #include "asio/basic_random_access_file.hpp" @@ -59,21 +58,27 @@ #include "asio/buffered_write_stream_fwd.hpp" #include "asio/buffered_write_stream.hpp" #include "asio/buffers_iterator.hpp" +#include "asio/cancel_after.hpp" +#include "asio/cancel_at.hpp" #include "asio/cancellation_signal.hpp" #include "asio/cancellation_state.hpp" #include "asio/cancellation_type.hpp" +#include "asio/co_composed.hpp" #include "asio/co_spawn.hpp" #include "asio/completion_condition.hpp" #include "asio/compose.hpp" +#include "asio/composed.hpp" +#include "asio/config.hpp" #include "asio/connect.hpp" #include "asio/connect_pipe.hpp" #include "asio/consign.hpp" #include "asio/coroutine.hpp" -#include "asio/deadline_timer.hpp" #include "asio/defer.hpp" #include "asio/deferred.hpp" +#include "asio/default_completion_token.hpp" #include "asio/detached.hpp" #include "asio/dispatch.hpp" +#include "asio/disposition.hpp" #include "asio/error.hpp" #include "asio/error_code.hpp" #include "asio/execution.hpp" @@ -81,30 +86,15 @@ #include "asio/execution/any_executor.hpp" #include "asio/execution/blocking.hpp" #include "asio/execution/blocking_adaptation.hpp" -#include "asio/execution/bulk_execute.hpp" -#include "asio/execution/bulk_guarantee.hpp" -#include "asio/execution/connect.hpp" #include "asio/execution/context.hpp" #include "asio/execution/context_as.hpp" -#include "asio/execution/execute.hpp" #include "asio/execution/executor.hpp" #include "asio/execution/invocable_archetype.hpp" #include "asio/execution/mapping.hpp" #include "asio/execution/occupancy.hpp" -#include "asio/execution/operation_state.hpp" #include "asio/execution/outstanding_work.hpp" #include "asio/execution/prefer_only.hpp" -#include "asio/execution/receiver.hpp" -#include "asio/execution/receiver_invocation_error.hpp" #include "asio/execution/relationship.hpp" -#include "asio/execution/schedule.hpp" -#include "asio/execution/scheduler.hpp" -#include "asio/execution/sender.hpp" -#include "asio/execution/set_done.hpp" -#include "asio/execution/set_error.hpp" -#include "asio/execution/set_value.hpp" -#include "asio/execution/start.hpp" -#include "asio/execution_context.hpp" #include "asio/executor.hpp" #include "asio/executor_work_guard.hpp" #include "asio/file_base.hpp" @@ -113,14 +103,11 @@ #include "asio/generic/raw_protocol.hpp" #include "asio/generic/seq_packet_protocol.hpp" #include "asio/generic/stream_protocol.hpp" -#include "asio/handler_alloc_hook.hpp" #include "asio/handler_continuation_hook.hpp" -#include "asio/handler_invoke_hook.hpp" #include "asio/high_resolution_timer.hpp" +#include "asio/immediate.hpp" #include "asio/io_context.hpp" #include "asio/io_context_strand.hpp" -#include "asio/io_service.hpp" -#include "asio/io_service_strand.hpp" #include "asio/ip/address.hpp" #include "asio/ip/address_v4.hpp" #include "asio/ip/address_v4_iterator.hpp" @@ -194,7 +181,6 @@ #include "asio/this_coro.hpp" #include "asio/thread.hpp" #include "asio/thread_pool.hpp" -#include "asio/time_traits.hpp" #include "asio/use_awaitable.hpp" #include "asio/use_future.hpp" #include "asio/uses_executor.hpp" diff --git a/thirdparty/asio/asio/any_completion_executor.hpp b/thirdparty/asio/asio/any_completion_executor.hpp index 420927cc1..c270b8d28 100644 --- a/thirdparty/asio/asio/any_completion_executor.hpp +++ b/thirdparty/asio/asio/any_completion_executor.hpp @@ -2,7 +2,7 @@ // any_completion_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -75,20 +75,18 @@ class any_completion_executor : #endif // !defined(GENERATING_DOCUMENTATION) /// Default constructor. - ASIO_DECL any_completion_executor() ASIO_NOEXCEPT; + ASIO_DECL any_completion_executor() noexcept; /// Construct in an empty state. Equivalent effects to default constructor. - ASIO_DECL any_completion_executor(nullptr_t) ASIO_NOEXCEPT; + ASIO_DECL any_completion_executor(nullptr_t) noexcept; /// Copy constructor. ASIO_DECL any_completion_executor( - const any_completion_executor& e) ASIO_NOEXCEPT; + const any_completion_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move constructor. ASIO_DECL any_completion_executor( - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + any_completion_executor&& e) noexcept; /// Construct to point to the same target as another any_executor. #if defined(GENERATING_DOCUMENTATION) @@ -98,7 +96,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(OtherAnyExecutor e, - typename constraint< + constraint_t< conditional< !is_same::value && is_base_of, false_type >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -122,7 +120,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(std::nothrow_t, OtherAnyExecutor e, - typename constraint< + constraint_t< conditional< !is_same::value && is_base_of, false_type >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. ASIO_DECL any_completion_executor(std::nothrow_t, - const any_completion_executor& e) ASIO_NOEXCEPT; + const any_completion_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. ASIO_DECL any_completion_executor(std::nothrow_t, - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + any_completion_executor&& e) noexcept; /// Construct a polymorphic wrapper for the specified executor. #if defined(GENERATING_DOCUMENTATION) @@ -155,7 +151,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(Executor e, - typename constraint< + constraint_t< conditional< !is_same::value && !is_base_of, false_type >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(Executor)(e)) + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -177,7 +173,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(std::nothrow_t, Executor e, - typename constraint< + constraint_t< conditional< !is_same::value && !is_base_of, false_type >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(Executor)(e)) + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Assignment operator. ASIO_DECL any_completion_executor& operator=( - const any_completion_executor& e) ASIO_NOEXCEPT; + const any_completion_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move assignment operator. ASIO_DECL any_completion_executor& operator=( - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + any_completion_executor&& e) noexcept; /// Assignment operator that sets the polymorphic wrapper to the empty state. ASIO_DECL any_completion_executor& operator=(nullptr_t); @@ -209,7 +203,7 @@ class any_completion_executor : ASIO_DECL ~any_completion_executor(); /// Swap targets with another polymorphic wrapper. - ASIO_DECL void swap(any_completion_executor& other) ASIO_NOEXCEPT; + ASIO_DECL void swap(any_completion_executor& other) noexcept; /// Obtain a polymorphic wrapper with the specified property. /** @@ -222,9 +216,9 @@ class any_completion_executor : */ template any_completion_executor require(const Property& p, - typename constraint< + constraint_t< traits::require_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).require(p); } @@ -240,9 +234,9 @@ class any_completion_executor : */ template any_completion_executor prefer(const Property& p, - typename constraint< + constraint_t< traits::prefer_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).prefer(p); } diff --git a/thirdparty/asio/asio/any_completion_handler.hpp b/thirdparty/asio/asio/any_completion_handler.hpp index cd114537f..1114a09c6 100644 --- a/thirdparty/asio/asio/any_completion_handler.hpp +++ b/thirdparty/asio/asio/any_completion_handler.hpp @@ -2,7 +2,7 @@ // any_completion_handler.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -12,20 +12,16 @@ #define ASIO_ANY_COMPLETION_HANDLER_HPP #include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_MOVE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - #include #include #include #include #include "asio/any_completion_executor.hpp" +#include "asio/any_io_executor.hpp" #include "asio/associated_allocator.hpp" #include "asio/associated_cancellation_slot.hpp" #include "asio/associated_executor.hpp" +#include "asio/associated_immediate_executor.hpp" #include "asio/cancellation_state.hpp" #include "asio/recycling_allocator.hpp" @@ -39,11 +35,11 @@ class any_completion_handler_impl_base public: template explicit any_completion_handler_impl_base(S&& slot) - : cancel_state_(ASIO_MOVE_CAST(S)(slot), enable_total_cancellation()) + : cancel_state_(static_cast(slot), enable_total_cancellation()) { } - cancellation_slot get_cancellation_slot() const ASIO_NOEXCEPT + cancellation_slot get_cancellation_slot() const noexcept { return cancel_state_.slot(); } @@ -59,8 +55,8 @@ class any_completion_handler_impl : public: template any_completion_handler_impl(S&& slot, H&& h) - : any_completion_handler_impl_base(ASIO_MOVE_CAST(S)(slot)), - handler_(ASIO_MOVE_CAST(H)(h)) + : any_completion_handler_impl_base(static_cast(slot)), + handler_(static_cast(h)) { } @@ -103,7 +99,7 @@ class any_completion_handler_impl : any_completion_handler_impl* ptr = new (uninit_ptr.get()) any_completion_handler_impl( - ASIO_MOVE_CAST(S)(slot), ASIO_MOVE_CAST(H)(h)); + static_cast(slot), static_cast(h)); uninit_ptr.release(); return ptr; @@ -119,13 +115,20 @@ class any_completion_handler_impl : } any_completion_executor executor( - const any_completion_executor& candidate) const ASIO_NOEXCEPT + const any_completion_executor& candidate) const noexcept { return any_completion_executor(std::nothrow, (get_associated_executor)(handler_, candidate)); } - void* allocate(std::size_t size, std::size_t align) const + any_completion_executor immediate_executor( + const any_io_executor& candidate) const noexcept + { + return any_completion_executor(std::nothrow, + (get_associated_immediate_executor)(handler_, candidate)); + } + + void* allocate(std::size_t size, std::size_t align_size) const { typename std::allocator_traits< associated_allocator_t())); - std::size_t space = size + align - 1; + std::size_t space = size + align_size - 1; unsigned char* base = std::allocator_traits::allocate( alloc, space + sizeof(std::ptrdiff_t)); void* p = base; - if (detail::align(align, size, p, space)) + if (detail::align(align_size, size, p, space)) { std::ptrdiff_t off = static_cast(p) - base; std::memcpy(static_cast(p) + size, &off, sizeof(off)); @@ -180,11 +183,11 @@ class any_completion_handler_impl : asio::recycling_allocator())}; std::unique_ptr ptr(this, d); - Handler handler(ASIO_MOVE_CAST(Handler)(handler_)); + Handler handler(static_cast(handler_)); ptr.reset(); - ASIO_MOVE_CAST(Handler)(handler)( - ASIO_MOVE_CAST(Args)(args)...); + static_cast(handler)( + static_cast(args)...); } private: @@ -207,14 +210,14 @@ class any_completion_handler_call_fn void call(any_completion_handler_impl_base* impl, Args... args) const { - call_fn_(impl, ASIO_MOVE_CAST(Args)(args)...); + call_fn_(impl, static_cast(args)...); } template static void impl(any_completion_handler_impl_base* impl, Args... args) { static_cast*>(impl)->call( - ASIO_MOVE_CAST(Args)(args)...); + static_cast(args)...); } private: @@ -305,6 +308,36 @@ class any_completion_handler_executor_fn type executor_fn_; }; +class any_completion_handler_immediate_executor_fn +{ +public: + using type = any_completion_executor(*)( + any_completion_handler_impl_base*, const any_io_executor&); + + constexpr any_completion_handler_immediate_executor_fn(type fn) + : immediate_executor_fn_(fn) + { + } + + any_completion_executor immediate_executor( + any_completion_handler_impl_base* impl, + const any_io_executor& candidate) const + { + return immediate_executor_fn_(impl, candidate); + } + + template + static any_completion_executor impl(any_completion_handler_impl_base* impl, + const any_io_executor& candidate) + { + return static_cast*>( + impl)->immediate_executor(candidate); + } + +private: + type immediate_executor_fn_; +}; + class any_completion_handler_allocate_fn { public: @@ -367,6 +400,7 @@ template class any_completion_handler_fn_table : private any_completion_handler_destroy_fn, private any_completion_handler_executor_fn, + private any_completion_handler_immediate_executor_fn, private any_completion_handler_allocate_fn, private any_completion_handler_deallocate_fn, private any_completion_handler_call_fns @@ -376,11 +410,13 @@ class any_completion_handler_fn_table constexpr any_completion_handler_fn_table( any_completion_handler_destroy_fn::type destroy_fn, any_completion_handler_executor_fn::type executor_fn, + any_completion_handler_immediate_executor_fn::type immediate_executor_fn, any_completion_handler_allocate_fn::type allocate_fn, any_completion_handler_deallocate_fn::type deallocate_fn, CallFns... call_fns) : any_completion_handler_destroy_fn(destroy_fn), any_completion_handler_executor_fn(executor_fn), + any_completion_handler_immediate_executor_fn(immediate_executor_fn), any_completion_handler_allocate_fn(allocate_fn), any_completion_handler_deallocate_fn(deallocate_fn), any_completion_handler_call_fns(call_fns...) @@ -389,6 +425,7 @@ class any_completion_handler_fn_table using any_completion_handler_destroy_fn::destroy; using any_completion_handler_executor_fn::executor; + using any_completion_handler_immediate_executor_fn::immediate_executor; using any_completion_handler_allocate_fn::allocate; using any_completion_handler_deallocate_fn::deallocate; using any_completion_handler_call_fns::call; @@ -401,6 +438,7 @@ struct any_completion_handler_fn_table_instance value = any_completion_handler_fn_table( &any_completion_handler_destroy_fn::impl, &any_completion_handler_executor_fn::impl, + &any_completion_handler_immediate_executor_fn::impl, &any_completion_handler_allocate_fn::impl, &any_completion_handler_deallocate_fn::impl, &any_completion_handler_call_fn::template impl...); @@ -431,7 +469,7 @@ class any_completion_handler_allocator detail::any_completion_handler_impl_base* impl_; constexpr any_completion_handler_allocator(int, - const any_completion_handler& h) ASIO_NOEXCEPT + const any_completion_handler& h) noexcept : fn_table_(h.fn_table_), impl_(h.impl_) { @@ -453,7 +491,7 @@ class any_completion_handler_allocator template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) - ASIO_NOEXCEPT + noexcept : fn_table_(a.fn_table_), impl_(a.impl_) { @@ -461,14 +499,14 @@ class any_completion_handler_allocator /// Equality operator. constexpr bool operator==( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } /// Inequality operator. constexpr bool operator!=( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ != other.fn_table_ || impl_ != other.impl_; } @@ -476,9 +514,15 @@ class any_completion_handler_allocator /// Allocate space for @c n objects of the allocator's value type. T* allocate(std::size_t n) const { - return static_cast( - fn_table_->allocate( - impl_, sizeof(T) * n, alignof(T))); + if (fn_table_) + { + return static_cast( + fn_table_->allocate( + impl_, sizeof(T) * n, alignof(T))); + } + std::bad_alloc ex; + asio::detail::throw_exception(ex); + return nullptr; } /// Deallocate space for @c n objects of the allocator's value type. @@ -505,7 +549,7 @@ class any_completion_handler_allocator detail::any_completion_handler_impl_base* impl_; constexpr any_completion_handler_allocator(int, - const any_completion_handler& h) ASIO_NOEXCEPT + const any_completion_handler& h) noexcept : fn_table_(h.fn_table_), impl_(h.impl_) { @@ -527,7 +571,7 @@ class any_completion_handler_allocator template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) - ASIO_NOEXCEPT + noexcept : fn_table_(a.fn_table_), impl_(a.impl_) { @@ -535,14 +579,14 @@ class any_completion_handler_allocator /// Equality operator. constexpr bool operator==( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } /// Inequality operator. constexpr bool operator!=( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ != other.fn_table_ || impl_ != other.impl_; } @@ -576,6 +620,9 @@ class any_completion_handler template friend struct associated_executor; + template + friend struct associated_immediate_executor; + const detail::any_completion_handler_fn_table* fn_table_; detail::any_completion_handler_impl_base* impl_; #endif // !defined(GENERATING_DOCUMENTATION) @@ -604,16 +651,16 @@ class any_completion_handler } /// Construct an @c any_completion_handler to contain the specified target. - template ::type> + template > any_completion_handler(H&& h, - typename constraint< - !is_same::type, any_completion_handler>::value - >::type = 0) + constraint_t< + !is_same, any_completion_handler>::value + > = 0) : fn_table_( &detail::any_completion_handler_fn_table_instance< Handler, Signatures...>::value), impl_(detail::any_completion_handler_impl::create( - (get_associated_cancellation_slot)(h), ASIO_MOVE_CAST(H)(h))) + (get_associated_cancellation_slot)(h), static_cast(h))) { } @@ -621,7 +668,7 @@ class any_completion_handler /** * After the operation, the moved-from object @c other has no target. */ - any_completion_handler(any_completion_handler&& other) ASIO_NOEXCEPT + any_completion_handler(any_completion_handler&& other) noexcept : fn_table_(other.fn_table_), impl_(other.impl_) { @@ -634,15 +681,15 @@ class any_completion_handler * After the operation, the moved-from object @c other has no target. */ any_completion_handler& operator=( - any_completion_handler&& other) ASIO_NOEXCEPT + any_completion_handler&& other) noexcept { any_completion_handler( - ASIO_MOVE_CAST(any_completion_handler)(other)).swap(*this); + static_cast(other)).swap(*this); return *this; } /// Assignment operator that sets the polymorphic wrapper to the empty state. - any_completion_handler& operator=(nullptr_t) ASIO_NOEXCEPT + any_completion_handler& operator=(nullptr_t) noexcept { any_completion_handler().swap(*this); return *this; @@ -656,34 +703,34 @@ class any_completion_handler } /// Test if the polymorphic wrapper is empty. - constexpr explicit operator bool() const ASIO_NOEXCEPT + constexpr explicit operator bool() const noexcept { return impl_ != nullptr; } /// Test if the polymorphic wrapper is non-empty. - constexpr bool operator!() const ASIO_NOEXCEPT + constexpr bool operator!() const noexcept { return impl_ == nullptr; } /// Swap the content of an @c any_completion_handler with another. - void swap(any_completion_handler& other) ASIO_NOEXCEPT + void swap(any_completion_handler& other) noexcept { std::swap(fn_table_, other.fn_table_); std::swap(impl_, other.impl_); } /// Get the associated allocator. - allocator_type get_allocator() const ASIO_NOEXCEPT + allocator_type get_allocator() const noexcept { return allocator_type(0, *this); } /// Get the associated cancellation slot. - cancellation_slot_type get_cancellation_slot() const ASIO_NOEXCEPT + cancellation_slot_type get_cancellation_slot() const noexcept { - return impl_->get_cancellation_slot(); + return impl_ ? impl_->get_cancellation_slot() : cancellation_slot_type(); } /// Function call operator. @@ -697,12 +744,12 @@ class any_completion_handler */ template auto operator()(Args&&... args) - -> decltype(fn_table_->call(impl_, ASIO_MOVE_CAST(Args)(args)...)) + -> decltype(fn_table_->call(impl_, static_cast(args)...)) { if (detail::any_completion_handler_impl_base* impl = impl_) { impl_ = nullptr; - return fn_table_->call(impl, ASIO_MOVE_CAST(Args)(args)...); + return fn_table_->call(impl, static_cast(args)...); } std::bad_function_call ex; asio::detail::throw_exception(ex); @@ -710,28 +757,28 @@ class any_completion_handler /// Equality operator. friend constexpr bool operator==( - const any_completion_handler& a, nullptr_t) ASIO_NOEXCEPT + const any_completion_handler& a, nullptr_t) noexcept { return a.impl_ == nullptr; } /// Equality operator. friend constexpr bool operator==( - nullptr_t, const any_completion_handler& b) ASIO_NOEXCEPT + nullptr_t, const any_completion_handler& b) noexcept { return nullptr == b.impl_; } /// Inequality operator. friend constexpr bool operator!=( - const any_completion_handler& a, nullptr_t) ASIO_NOEXCEPT + const any_completion_handler& a, nullptr_t) noexcept { return a.impl_ != nullptr; } /// Inequality operator. friend constexpr bool operator!=( - nullptr_t, const any_completion_handler& b) ASIO_NOEXCEPT + nullptr_t, const any_completion_handler& b) noexcept { return nullptr != b.impl_; } @@ -743,10 +790,28 @@ struct associated_executor, Candidate> using type = any_completion_executor; static type get(const any_completion_handler& handler, - const Candidate& candidate = Candidate()) ASIO_NOEXCEPT + const Candidate& candidate = Candidate()) noexcept { - return handler.fn_table_->executor(handler.impl_, - any_completion_executor(std::nothrow, candidate)); + any_completion_executor any_candidate(std::nothrow, candidate); + return handler.fn_table_ + ? handler.fn_table_->executor(handler.impl_, any_candidate) + : any_candidate; + } +}; + +template +struct associated_immediate_executor< + any_completion_handler, Candidate> +{ + using type = any_completion_executor; + + static type get(const any_completion_handler& handler, + const Candidate& candidate = Candidate()) noexcept + { + any_io_executor any_candidate(std::nothrow, candidate); + return handler.fn_table_ + ? handler.fn_table_->immediate_executor(handler.impl_, any_candidate) + : any_candidate; } }; @@ -754,9 +819,4 @@ struct associated_executor, Candidate> #include "asio/detail/pop_options.hpp" -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_MOVE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - #endif // ASIO_ANY_COMPLETION_HANDLER_HPP diff --git a/thirdparty/asio/asio/any_io_executor.hpp b/thirdparty/asio/asio/any_io_executor.hpp index 7a77c90d1..a6c9c8dae 100644 --- a/thirdparty/asio/asio/any_io_executor.hpp +++ b/thirdparty/asio/asio/any_io_executor.hpp @@ -2,7 +2,7 @@ // any_io_executor.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -87,18 +87,16 @@ class any_io_executor : #endif // !defined(GENERATING_DOCUMENTATION) /// Default constructor. - ASIO_DECL any_io_executor() ASIO_NOEXCEPT; + ASIO_DECL any_io_executor() noexcept; /// Construct in an empty state. Equivalent effects to default constructor. - ASIO_DECL any_io_executor(nullptr_t) ASIO_NOEXCEPT; + ASIO_DECL any_io_executor(nullptr_t) noexcept; /// Copy constructor. - ASIO_DECL any_io_executor(const any_io_executor& e) ASIO_NOEXCEPT; + ASIO_DECL any_io_executor(const any_io_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move constructor. - ASIO_DECL any_io_executor(any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + ASIO_DECL any_io_executor(any_io_executor&& e) noexcept; /// Construct to point to the same target as another any_executor. #if defined(GENERATING_DOCUMENTATION) @@ -107,8 +105,8 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(OtherAnyExecutor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && is_base_of::value, @@ -116,9 +114,9 @@ class any_io_executor : 0, supportable_properties_type>::template is_valid_target, false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + >::value + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -131,8 +129,8 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(std::nothrow_t, OtherAnyExecutor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && is_base_of::value, @@ -140,22 +138,19 @@ class any_io_executor : 0, supportable_properties_type>::template is_valid_target, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + >::value + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. ASIO_DECL any_io_executor(std::nothrow_t, - const any_io_executor& e) ASIO_NOEXCEPT; + const any_io_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. - ASIO_DECL any_io_executor(std::nothrow_t, - any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + ASIO_DECL any_io_executor(std::nothrow_t, any_io_executor&& e) noexcept; /// Construct a polymorphic wrapper for the specified executor. #if defined(GENERATING_DOCUMENTATION) @@ -164,17 +159,17 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(Executor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && !is_base_of::value, execution::detail::is_valid_target_executor< Executor, supportable_properties_type>, false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(Executor)(e)) + >::value + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -186,30 +181,27 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(std::nothrow_t, Executor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && !is_base_of::value, execution::detail::is_valid_target_executor< Executor, supportable_properties_type>, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(Executor)(e)) + >::value + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Assignment operator. ASIO_DECL any_io_executor& operator=( - const any_io_executor& e) ASIO_NOEXCEPT; + const any_io_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move assignment operator. - ASIO_DECL any_io_executor& operator=( - any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + ASIO_DECL any_io_executor& operator=(any_io_executor&& e) noexcept; /// Assignment operator that sets the polymorphic wrapper to the empty state. ASIO_DECL any_io_executor& operator=(nullptr_t); @@ -218,7 +210,7 @@ class any_io_executor : ASIO_DECL ~any_io_executor(); /// Swap targets with another polymorphic wrapper. - ASIO_DECL void swap(any_io_executor& other) ASIO_NOEXCEPT; + ASIO_DECL void swap(any_io_executor& other) noexcept; /// Obtain a polymorphic wrapper with the specified property. /** @@ -231,9 +223,9 @@ class any_io_executor : */ template any_io_executor require(const Property& p, - typename constraint< + constraint_t< traits::require_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).require(p); } @@ -249,9 +241,9 @@ class any_io_executor : */ template any_io_executor prefer(const Property& p, - typename constraint< + constraint_t< traits::prefer_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).prefer(p); } diff --git a/thirdparty/asio/asio/append.hpp b/thirdparty/asio/asio/append.hpp index 9ac4a9504..e0167e13b 100644 --- a/thirdparty/asio/asio/append.hpp +++ b/thirdparty/asio/asio/append.hpp @@ -2,7 +2,7 @@ // append.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,11 +16,6 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - #include #include "asio/detail/type_traits.hpp" @@ -37,11 +32,9 @@ class append_t public: /// Constructor. template - ASIO_CONSTEXPR explicit append_t( - ASIO_MOVE_ARG(T) completion_token, - ASIO_MOVE_ARG(V)... values) - : token_(ASIO_MOVE_CAST(T)(completion_token)), - values_(ASIO_MOVE_CAST(V)(values)...) + constexpr explicit append_t(T&& completion_token, V&&... values) + : token_(static_cast(completion_token)), + values_(static_cast(values)...) { } @@ -54,15 +47,13 @@ class append_t /// arguments should be passed additional values after the results of the /// operation. template -ASIO_NODISCARD inline ASIO_CONSTEXPR append_t< - typename decay::type, typename decay::type...> -append(ASIO_MOVE_ARG(CompletionToken) completion_token, - ASIO_MOVE_ARG(Values)... values) +ASIO_NODISCARD inline constexpr +append_t, decay_t...> +append(CompletionToken&& completion_token, Values&&... values) { - return append_t< - typename decay::type, typename decay::type...>( - ASIO_MOVE_CAST(CompletionToken)(completion_token), - ASIO_MOVE_CAST(Values)(values)...); + return append_t, decay_t...>( + static_cast(completion_token), + static_cast(values)...); } } // namespace asio @@ -71,8 +62,4 @@ append(ASIO_MOVE_ARG(CompletionToken) completion_token, #include "asio/impl/append.hpp" -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - #endif // ASIO_APPEND_HPP diff --git a/thirdparty/asio/asio/as_tuple.hpp b/thirdparty/asio/asio/as_tuple.hpp index 96ac47c82..d3250b75e 100644 --- a/thirdparty/asio/asio/as_tuple.hpp +++ b/thirdparty/asio/asio/as_tuple.hpp @@ -2,7 +2,7 @@ // as_tuple.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,11 +16,6 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - #include "asio/detail/type_traits.hpp" #include "asio/detail/push_options.hpp" @@ -50,18 +45,18 @@ class as_tuple_t * token is itself defaulted as an argument to allow it to capture a source * location. */ - ASIO_CONSTEXPR as_tuple_t( + constexpr as_tuple_t( default_constructor_tag = default_constructor_tag(), CompletionToken token = CompletionToken()) - : token_(ASIO_MOVE_CAST(CompletionToken)(token)) + : token_(static_cast(token)) { } /// Constructor. template - ASIO_CONSTEXPR explicit as_tuple_t( - ASIO_MOVE_ARG(T) completion_token) - : token_(ASIO_MOVE_CAST(T)(completion_token)) + constexpr explicit as_tuple_t( + T&& completion_token) + : token_(static_cast(completion_token)) { } @@ -76,13 +71,13 @@ class as_tuple_t /// Construct the adapted executor from the inner executor type. template executor_with_default(const InnerExecutor1& ex, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value, is_convertible, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT + >::value + > = 0) noexcept : InnerExecutor(ex) { } @@ -90,41 +85,63 @@ class as_tuple_t /// Type alias to adapt an I/O object to use @c as_tuple_t as its /// default completion token type. -#if defined(ASIO_HAS_ALIAS_TEMPLATES) \ - || defined(GENERATING_DOCUMENTATION) template using as_default_on_t = typename T::template rebind_executor< - executor_with_default >::other; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) + executor_with_default>::other; /// Function helper to adapt an I/O object to use @c as_tuple_t as its /// default completion token type. template - static typename decay::type::template rebind_executor< - executor_with_default::type::executor_type> + static typename decay_t::template rebind_executor< + executor_with_default::executor_type> >::other - as_default_on(ASIO_MOVE_ARG(T) object) + as_default_on(T&& object) { - return typename decay::type::template rebind_executor< - executor_with_default::type::executor_type> - >::other(ASIO_MOVE_CAST(T)(object)); + return typename decay_t::template rebind_executor< + executor_with_default::executor_type> + >::other(static_cast(object)); } //private: CompletionToken token_; }; -/// Adapt a @ref completion_token to specify that the completion handler -/// arguments should be combined into a single tuple argument. -template -ASIO_NODISCARD inline -ASIO_CONSTEXPR as_tuple_t::type> -as_tuple(ASIO_MOVE_ARG(CompletionToken) completion_token) +/// A function object type that adapts a @ref completion_token to specify that +/// the completion handler arguments should be combined into a single tuple +/// argument. +/** + * May also be used directly as a completion token, in which case it adapts the + * asynchronous operation's default completion token (or asio::deferred + * if no default is available). + */ +struct partial_as_tuple { - return as_tuple_t::type>( - ASIO_MOVE_CAST(CompletionToken)(completion_token)); -} + /// Default constructor. + constexpr partial_as_tuple() + { + } + + /// Adapt a @ref completion_token to specify that the completion handler + /// arguments should be combined into a single tuple argument. + template + ASIO_NODISCARD inline + constexpr as_tuple_t> + operator()(CompletionToken&& completion_token) const + { + return as_tuple_t>( + static_cast(completion_token)); + } +}; + +/// A function object that adapts a @ref completion_token to specify that the +/// completion handler arguments should be combined into a single tuple +/// argument. +/** + * May also be used directly as a completion token, in which case it adapts the + * asynchronous operation's default completion token (or asio::deferred + * if no default is available). + */ +ASIO_INLINE_VARIABLE constexpr partial_as_tuple as_tuple; } // namespace asio @@ -132,8 +149,4 @@ as_tuple(ASIO_MOVE_ARG(CompletionToken) completion_token) #include "asio/impl/as_tuple.hpp" -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - #endif // ASIO_AS_TUPLE_HPP diff --git a/thirdparty/asio/asio/associated_allocator.hpp b/thirdparty/asio/asio/associated_allocator.hpp index 8e864673c..c15ff6dc5 100644 --- a/thirdparty/asio/asio/associated_allocator.hpp +++ b/thirdparty/asio/asio/associated_allocator.hpp @@ -2,7 +2,7 @@ // associated_allocator.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -36,9 +36,7 @@ struct has_allocator_type : false_type }; template -struct has_allocator_type::type> - : true_type +struct has_allocator_type> : true_type { }; @@ -49,33 +47,30 @@ struct associated_allocator_impl typedef A type; - static type get(const T&) ASIO_NOEXCEPT + static type get(const T&) noexcept { return type(); } - static const type& get(const T&, const A& a) ASIO_NOEXCEPT + static const type& get(const T&, const A& a) noexcept { return a; } }; template -struct associated_allocator_impl::type> +struct associated_allocator_impl> { typedef typename T::allocator_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_allocator())) + static auto get(const T& t) noexcept + -> decltype(t.get_allocator()) { return t.get_allocator(); } - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const A&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_allocator())) + static auto get(const T& t, const A&) noexcept + -> decltype(t.get_allocator()) { return t.get_allocator(); } @@ -83,12 +78,12 @@ struct associated_allocator_impl struct associated_allocator_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -115,7 +110,7 @@ struct associated_allocator_impl > +template > struct associated_allocator #if !defined(GENERATING_DOCUMENTATION) : detail::associated_allocator_impl @@ -128,11 +123,11 @@ struct associated_allocator /// If @c T has a nested type @c allocator_type, returns /// t.get_allocator(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t) noexcept; /// If @c T has a nested type @c allocator_type, returns /// t.get_allocator(). Otherwise returns @c a. - static decltype(auto) get(const T& t, const Allocator& a) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t, const Allocator& a) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -142,7 +137,7 @@ struct associated_allocator */ template ASIO_NODISCARD inline typename associated_allocator::type -get_associated_allocator(const T& t) ASIO_NOEXCEPT +get_associated_allocator(const T& t) noexcept { return associated_allocator::get(t); } @@ -152,23 +147,17 @@ get_associated_allocator(const T& t) ASIO_NOEXCEPT * @returns associated_allocator::get(t, a) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_allocator::type) -get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_allocator::get(t, a))) +ASIO_NODISCARD inline auto get_associated_allocator( + const T& t, const Allocator& a) noexcept + -> decltype(associated_allocator::get(t, a)) { return associated_allocator::get(t, a); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template > +template > using associated_allocator_t = typename associated_allocator::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -178,22 +167,19 @@ struct associated_allocator_forwarding_base template struct associated_allocator_forwarding_base::asio_associated_allocator_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_allocator_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_allocator for @c std::reference_wrapper. template struct associated_allocator, Allocator> @@ -207,25 +193,20 @@ struct associated_allocator, Allocator> /// Forwards the request to get the allocator to the associator specialisation /// for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT + static type get(reference_wrapper t) noexcept { return associated_allocator::get(t.get()); } /// Forwards the request to get the allocator to the associator specialisation /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Allocator& a) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_allocator::get(t.get(), a))) + static auto get(reference_wrapper t, const Allocator& a) noexcept + -> decltype(associated_allocator::get(t.get(), a)) { return associated_allocator::get(t.get(), a); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/thirdparty/asio/asio/associated_cancellation_slot.hpp b/thirdparty/asio/asio/associated_cancellation_slot.hpp index 65d82b646..79dccecd4 100644 --- a/thirdparty/asio/asio/associated_cancellation_slot.hpp +++ b/thirdparty/asio/asio/associated_cancellation_slot.hpp @@ -2,7 +2,7 @@ // associated_cancellation_slot.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -36,9 +36,8 @@ struct has_cancellation_slot_type : false_type }; template -struct has_cancellation_slot_type::type> - : true_type +struct has_cancellation_slot_type> + : true_type { }; @@ -49,12 +48,12 @@ struct associated_cancellation_slot_impl typedef S type; - static type get(const T&) ASIO_NOEXCEPT + static type get(const T&) noexcept { return type(); } - static const type& get(const T&, const S& s) ASIO_NOEXCEPT + static const type& get(const T&, const S& s) noexcept { return s; } @@ -62,20 +61,18 @@ struct associated_cancellation_slot_impl template struct associated_cancellation_slot_impl::type> + void_t> { typedef typename T::cancellation_slot_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_cancellation_slot())) + static auto get(const T& t) noexcept + -> decltype(t.get_cancellation_slot()) { return t.get_cancellation_slot(); } - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const S&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_cancellation_slot())) + static auto get(const T& t, const S&) noexcept + -> decltype(t.get_cancellation_slot()) { return t.get_cancellation_slot(); } @@ -83,12 +80,12 @@ struct associated_cancellation_slot_impl struct associated_cancellation_slot_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -129,12 +126,12 @@ struct associated_cancellation_slot /// If @c T has a nested type @c cancellation_slot_type, returns /// t.get_cancellation_slot(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t) noexcept; /// If @c T has a nested type @c cancellation_slot_type, returns /// t.get_cancellation_slot(). Otherwise returns @c s. static decltype(auto) get(const T& t, - const CancellationSlot& s) ASIO_NOEXCEPT; + const CancellationSlot& s) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -144,7 +141,7 @@ struct associated_cancellation_slot */ template ASIO_NODISCARD inline typename associated_cancellation_slot::type -get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT +get_associated_cancellation_slot(const T& t) noexcept { return associated_cancellation_slot::get(t); } @@ -155,24 +152,17 @@ get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT * CancellationSlot>::get(t, st) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_cancellation_slot::type) -get_associated_cancellation_slot(const T& t, - const CancellationSlot& st) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_cancellation_slot::get(t, st))) +ASIO_NODISCARD inline auto get_associated_cancellation_slot( + const T& t, const CancellationSlot& st) noexcept + -> decltype(associated_cancellation_slot::get(t, st)) { return associated_cancellation_slot::get(t, st); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - template using associated_cancellation_slot_t = typename associated_cancellation_slot::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -182,22 +172,19 @@ struct associated_cancellation_slot_forwarding_base template struct associated_cancellation_slot_forwarding_base::asio_associated_cancellation_slot_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_cancellation_slot_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_cancellation_slot for @c /// std::reference_wrapper. template @@ -212,25 +199,21 @@ struct associated_cancellation_slot, CancellationSlot> /// Forwards the request to get the cancellation slot to the associator /// specialisation for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT + static type get(reference_wrapper t) noexcept { return associated_cancellation_slot::get(t.get()); } /// Forwards the request to get the cancellation slot to the associator /// specialisation for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get(reference_wrapper t, - const CancellationSlot& s) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_cancellation_slot::get(t.get(), s))) + static auto get(reference_wrapper t, const CancellationSlot& s) noexcept + -> decltype( + associated_cancellation_slot::get(t.get(), s)) { return associated_cancellation_slot::get(t.get(), s); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/thirdparty/asio/asio/associated_executor.hpp b/thirdparty/asio/asio/associated_executor.hpp index 92279891d..5e0746f6b 100644 --- a/thirdparty/asio/asio/associated_executor.hpp +++ b/thirdparty/asio/asio/associated_executor.hpp @@ -2,7 +2,7 @@ // associated_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -38,8 +38,7 @@ struct has_executor_type : false_type }; template -struct has_executor_type::type> +struct has_executor_type> : true_type { }; @@ -51,33 +50,30 @@ struct associated_executor_impl typedef E type; - static type get(const T&) ASIO_NOEXCEPT + static type get(const T&) noexcept { return type(); } - static const type& get(const T&, const E& e) ASIO_NOEXCEPT + static const type& get(const T&, const E& e) noexcept { return e; } }; template -struct associated_executor_impl::type> +struct associated_executor_impl> { typedef typename T::executor_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_executor())) + static auto get(const T& t) noexcept + -> decltype(t.get_executor()) { return t.get_executor(); } - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const E&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_executor())) + static auto get(const T& t, const E&) noexcept + -> decltype(t.get_executor()) { return t.get_executor(); } @@ -85,12 +81,12 @@ struct associated_executor_impl struct associated_executor_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -130,11 +126,11 @@ struct associated_executor /// If @c T has a nested type @c executor_type, returns /// t.get_executor(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t) noexcept; /// If @c T has a nested type @c executor_type, returns /// t.get_executor(). Otherwise returns @c ex. - static decltype(auto) get(const T& t, const Executor& ex) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t, const Executor& ex) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -144,7 +140,7 @@ struct associated_executor */ template ASIO_NODISCARD inline typename associated_executor::type -get_associated_executor(const T& t) ASIO_NOEXCEPT +get_associated_executor(const T& t) noexcept { return associated_executor::get(t); } @@ -154,14 +150,12 @@ get_associated_executor(const T& t) ASIO_NOEXCEPT * @returns associated_executor::get(t, ex) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_executor::type) -get_associated_executor(const T& t, const Executor& ex, - typename constraint< +ASIO_NODISCARD inline auto get_associated_executor( + const T& t, const Executor& ex, + constraint_t< is_executor::value || execution::is_executor::value - >::type = 0) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t, ex))) + > = 0) noexcept + -> decltype(associated_executor::get(t, ex)) { return associated_executor::get(t, ex); } @@ -175,20 +169,16 @@ template ASIO_NODISCARD inline typename associated_executor::type get_associated_executor(const T& t, ExecutionContext& ctx, - typename constraint::value>::type = 0) ASIO_NOEXCEPT + constraint_t::value> = 0) noexcept { return associated_executor::get(t, ctx.get_executor()); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - template using associated_executor_t = typename associated_executor::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -198,22 +188,19 @@ struct associated_executor_forwarding_base template struct associated_executor_forwarding_base::asio_associated_executor_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_executor_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_executor for @c std::reference_wrapper. template struct associated_executor, Executor> @@ -227,25 +214,20 @@ struct associated_executor, Executor> /// Forwards the request to get the executor to the associator specialisation /// for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT + static type get(reference_wrapper t) noexcept { return associated_executor::get(t.get()); } /// Forwards the request to get the executor to the associator specialisation /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Executor& ex) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t.get(), ex))) + static auto get(reference_wrapper t, const Executor& ex) noexcept + -> decltype(associated_executor::get(t.get(), ex)) { return associated_executor::get(t.get(), ex); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/thirdparty/asio/asio/associated_immediate_executor.hpp b/thirdparty/asio/asio/associated_immediate_executor.hpp index 54bced17a..9b1e0c637 100644 --- a/thirdparty/asio/asio/associated_immediate_executor.hpp +++ b/thirdparty/asio/asio/associated_immediate_executor.hpp @@ -2,7 +2,7 @@ // associated_immediate_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -41,7 +41,7 @@ struct has_immediate_executor_type : false_type template struct has_immediate_executor_type::type> + void_t> : true_type { }; @@ -49,9 +49,10 @@ struct has_immediate_executor_type struct default_immediate_executor { - typedef typename require_result::type type; + typedef decay_t> type; - static type get(const E& e) ASIO_NOEXCEPT + static auto get(const E& e) noexcept + -> decltype(asio::require(e, execution::blocking.never)) { return asio::require(e, execution::blocking.never); } @@ -59,59 +60,57 @@ struct default_immediate_executor template struct default_immediate_executor::value - >::type, - typename enable_if< + >, + enable_if_t< is_executor::value - >::type> + >> { class type : public E { public: template explicit type(const Executor1& e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value, is_convertible, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT + >::value + > = 0) noexcept : E(e) { } - type(const type& other) ASIO_NOEXCEPT + type(const type& other) noexcept : E(static_cast(other)) { } -#if defined(ASIO_HAS_MOVE) - type(type&& other) ASIO_NOEXCEPT - : E(ASIO_MOVE_CAST(E)(other)) + type(type&& other) noexcept + : E(static_cast(other)) { } -#endif // defined(ASIO_HAS_MOVE) template - void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const + void dispatch(Function&& f, const Allocator& a) const { - this->post(ASIO_MOVE_CAST(Function)(f), a); + this->post(static_cast(f), a); } - friend bool operator==(const type& a, const type& b) ASIO_NOEXCEPT + friend bool operator==(const type& a, const type& b) noexcept { return static_cast(a) == static_cast(b); } - friend bool operator!=(const type& a, const type& b) ASIO_NOEXCEPT + friend bool operator!=(const type& a, const type& b) noexcept { return static_cast(a) != static_cast(b); } }; - static type get(const E& e) ASIO_NOEXCEPT + static type get(const E& e) noexcept { return type(e); } @@ -124,9 +123,8 @@ struct associated_immediate_executor_impl typedef typename default_immediate_executor::type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T&, const E& e) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((default_immediate_executor::get(e))) + static auto get(const T&, const E& e) noexcept + -> decltype(default_immediate_executor::get(e)) { return default_immediate_executor::get(e); } @@ -134,13 +132,12 @@ struct associated_immediate_executor_impl template struct associated_immediate_executor_impl::type> + void_t> { typedef typename T::immediate_executor_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const E&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_immediate_executor())) + static auto get(const T& t, const E&) noexcept + -> decltype(t.get_immediate_executor()) { return t.get_immediate_executor(); } @@ -148,12 +145,12 @@ struct associated_immediate_executor_impl struct associated_immediate_executor_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -194,7 +191,7 @@ struct associated_immediate_executor /// If @c T has a nested type @c immediate_executor_type, returns /// t.get_immediate_executor(). Otherwise returns /// asio::require(ex, asio::execution::blocking.never). - static decltype(auto) get(const T& t, const Executor& ex) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t, const Executor& ex) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -203,14 +200,12 @@ struct associated_immediate_executor * @returns associated_immediate_executor::get(t, ex) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_immediate_executor::type) -get_associated_immediate_executor(const T& t, const Executor& ex, - typename constraint< +ASIO_NODISCARD inline auto get_associated_immediate_executor( + const T& t, const Executor& ex, + constraint_t< is_executor::value || execution::is_executor::value - >::type = 0) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_immediate_executor::get(t, ex))) + > = 0) noexcept + -> decltype(associated_immediate_executor::get(t, ex)) { return associated_immediate_executor::get(t, ex); } @@ -224,21 +219,18 @@ template ASIO_NODISCARD inline typename associated_immediate_executor::type get_associated_immediate_executor(const T& t, ExecutionContext& ctx, - typename constraint::value>::type = 0) ASIO_NOEXCEPT + constraint_t< + is_convertible::value + > = 0) noexcept { return associated_immediate_executor::get(t, ctx.get_executor()); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - template using associated_immediate_executor_t = typename associated_immediate_executor::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -248,22 +240,19 @@ struct associated_immediate_executor_forwarding_base template struct associated_immediate_executor_forwarding_base::asio_associated_immediate_executor_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_immediate_executor_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_immediate_executor for /// @c std::reference_wrapper. template @@ -278,18 +267,13 @@ struct associated_immediate_executor, Executor> /// Forwards the request to get the executor to the associator specialisation /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Executor& ex) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_immediate_executor::get(t.get(), ex))) + static auto get(reference_wrapper t, const Executor& ex) noexcept + -> decltype(associated_immediate_executor::get(t.get(), ex)) { return associated_immediate_executor::get(t.get(), ex); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/thirdparty/asio/asio/associator.hpp b/thirdparty/asio/asio/associator.hpp index e954c4428..5c4f382c1 100644 --- a/thirdparty/asio/asio/associator.hpp +++ b/thirdparty/asio/asio/associator.hpp @@ -2,7 +2,7 @@ // associator.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -23,7 +23,7 @@ namespace asio { /// Used to generically specialise associators for a type. template