From: Philippe Proulx Date: Tue, 6 Feb 2024 03:09:35 +0000 (-0500) Subject: cpp-common/vendor/optional-lite: bump to 3.6.0 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=008797c37fac5c570febd62deba33436993a64f4 cpp-common/vendor/optional-lite: bump to 3.6.0 Signed-off-by: Philippe Proulx Change-Id: I81ff349fb55cd3d3a0474fcff13ef10a439b852c Reviewed-on: https://review.lttng.org/c/babeltrace/+/11747 Tested-by: jenkins --- diff --git a/src/cpp-common/vendor/optional-lite/optional.hpp b/src/cpp-common/vendor/optional-lite/optional.hpp index 86e3b407..85febc3d 100644 --- a/src/cpp-common/vendor/optional-lite/optional.hpp +++ b/src/cpp-common/vendor/optional-lite/optional.hpp @@ -12,7 +12,7 @@ #define NONSTD_OPTIONAL_LITE_HPP #define optional_lite_MAJOR 3 -#define optional_lite_MINOR 5 +#define optional_lite_MINOR 6 #define optional_lite_PATCH 0 #define optional_lite_VERSION optional_STRINGIFY(optional_lite_MAJOR) "." optional_STRINGIFY(optional_lite_MINOR) "." optional_STRINGIFY(optional_lite_PATCH) @@ -56,14 +56,14 @@ # if defined(_MSC_VER) # include // for _HAS_EXCEPTIONS # endif -# if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || (_HAS_EXCEPTIONS) +# if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || (defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS)) # define optional_CONFIG_NO_EXCEPTIONS 0 # else # define optional_CONFIG_NO_EXCEPTIONS 1 # endif #endif -// C++ language version detection (C++20 is speculative): +// C++ language version detection (C++23 is speculative): // Note: VC14.0/1900 (VS2015) lacks too much from C++14. #ifndef optional_CPLUSPLUS @@ -79,7 +79,8 @@ #define optional_CPP11_OR_GREATER_ ( optional_CPLUSPLUS >= 201103L ) #define optional_CPP14_OR_GREATER ( optional_CPLUSPLUS >= 201402L ) #define optional_CPP17_OR_GREATER ( optional_CPLUSPLUS >= 201703L ) -#define optional_CPP20_OR_GREATER ( optional_CPLUSPLUS >= 202000L ) +#define optional_CPP20_OR_GREATER ( optional_CPLUSPLUS >= 202002L ) +#define optional_CPP23_OR_GREATER ( optional_CPLUSPLUS >= 202300L ) // C++ language version (represent 98 as 3): @@ -788,7 +789,7 @@ union storage_t void construct_value( value_type && v ) { - ::new( value_ptr() ) value_type( std::move( v ) ); + ::new( const_cast(static_cast(value_ptr())) ) value_type( std::move( v ) ); } template< class... Args > @@ -800,13 +801,13 @@ union storage_t template< class... Args > void emplace( Args&&... args ) { - ::new( value_ptr() ) value_type( std::forward(args)... ); + ::new( const_cast(static_cast(value_ptr())) ) value_type( std::forward(args)... ); } template< class U, class... Args > void emplace( std::initializer_list il, Args&&... args ) { - ::new( value_ptr() ) value_type( il, std::forward(args)... ); + ::new( const_cast(static_cast(value_ptr())) ) value_type( il, std::forward(args)... ); } #endif @@ -1554,7 +1555,7 @@ private: void initialize( V && value ) { assert( ! has_value() ); - contained.construct_value( std::move( value ) ); + contained.construct_value( std::forward( value ) ); has_value_ = true; }