From f703a8792535a7ebc30c734f2c9a09c534e6fdff Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Fri, 26 Apr 2024 22:17:00 +0900 Subject: [PATCH] Update vendor --- .../install/include/debug_assert.hpp | 452 +++++++++--------- .../debug_assert-config-version.cmake | 12 +- .../install/include/type_safe/flag_set.hpp | 19 + .../install/include/type_safe/reference.hpp | 46 +- .../include/type_safe/strong_typedef.hpp | 38 +- .../install/include/debug_assert.hpp | 452 +++++++++--------- .../debug_assert-config-version.cmake | 12 +- .../install/include/type_safe/flag_set.hpp | 19 + .../install/include/type_safe/reference.hpp | 46 +- .../include/type_safe/strong_typedef.hpp | 38 +- 10 files changed, 608 insertions(+), 526 deletions(-) diff --git a/example/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp b/example/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp index 787d5d7..0da8b74 100644 --- a/example/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp +++ b/example/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp @@ -25,55 +25,46 @@ #ifndef DEBUG_ASSERT_HPP_INCLUDED #define DEBUG_ASSERT_HPP_INCLUDED -#include +#include #ifndef DEBUG_ASSERT_NO_STDIO -#include +# include #endif #ifndef DEBUG_ASSERT_MARK_UNREACHABLE -#ifdef __GNUC__ -#define DEBUG_ASSERT_MARK_UNREACHABLE __builtin_unreachable() -#elif defined(_MSC_VER) -#define DEBUG_ASSERT_MARK_UNREACHABLE __assume(0) -#else +# ifdef __GNUC__ +# define DEBUG_ASSERT_MARK_UNREACHABLE __builtin_unreachable() +# elif defined(_MSC_VER) +# define DEBUG_ASSERT_MARK_UNREACHABLE __assume(0) +# else /// Hint to the compiler that a code branch is unreachable. /// Define it yourself prior to including the header to override it. /// \notes This must be usable in an expression. -#define DEBUG_ASSERT_MARK_UNREACHABLE -#endif -#endif - -#ifndef DEBUG_ASSERT_PURE_FUNCTION -#ifdef __GNUC__ -#define DEBUG_ASSERT_PURE_FUNCTION __attribute__((pure)) -#else -/// Hint to the compiler that a function is pure. -#define DEBUG_ASSERT_PURE_FUNCTION -#endif +# define DEBUG_ASSERT_MARK_UNREACHABLE +# endif #endif #ifndef DEBUG_ASSERT_FORCE_INLINE -#ifdef __GNUC__ -#define DEBUG_ASSERT_FORCE_INLINE [[gnu::always_inline]] inline -#elif defined(_MSC_VER) -#define DEBUG_ASSERT_FORCE_INLINE __forceinline -#else +# ifdef __GNUC__ +# define DEBUG_ASSERT_FORCE_INLINE [[gnu::always_inline]] inline +# elif defined(_MSC_VER) +# define DEBUG_ASSERT_FORCE_INLINE __forceinline +# else /// Strong hint to the compiler to inline a function. /// Define it yourself prior to including the header to override it. -#define DEBUG_ASSERT_FORCE_INLINE inline -#endif +# define DEBUG_ASSERT_FORCE_INLINE inline +# endif #endif namespace debug_assert { - //=== source location ===// - /// Defines a location in the source code. - struct source_location - { - const char* file_name; ///< The file name. - unsigned line_number; ///< The line number. - }; +//=== source location ===// +/// Defines a location in the source code. +struct source_location +{ + const char* file_name; ///< The file name. + unsigned line_number; ///< The line number. +}; /// Expands to the current [debug_assert::source_location](). #define DEBUG_ASSERT_CUR_SOURCE_LOCATION \ @@ -82,222 +73,225 @@ namespace debug_assert __FILE__, static_cast(__LINE__) \ } - //=== level ===// - /// Tag type to indicate the level of an assertion. - template - struct level +//=== level ===// +/// Tag type to indicate the level of an assertion. +template +struct level +{}; + +/// Helper class that sets a certain level. +/// Inherit from it in your module handler. +template +struct set_level +{ + static const unsigned level = Level; +}; + +template +const unsigned set_level::level; + +/// Helper class that controls whether the handler can throw or not. +/// Inherit from it in your module handler. +/// If the module does not inherit from this class, it is assumed that +/// the handle does not throw. +struct allow_exception +{ + static const bool throwing_exception_is_allowed = true; +}; + +//=== handler ===// +/// Does not do anything to handle a failed assertion (except calling +/// [std::abort()]()). +/// Inherit from it in your module handler. +struct no_handler +{ + /// \effects Does nothing. + /// \notes Can take any additional arguments. + template + static void handle(const source_location&, const char*, Args&&...) noexcept + {} +}; + +/// The default handler that writes a message to `stderr`. +/// Inherit from it in your module handler. +struct default_handler +{ + /// \effects Prints a message to `stderr`. + /// \notes It can optionally accept an additional message string. + /// \notes If `DEBUG_ASSERT_NO_STDIO` is defined, it will do nothing. + static void handle(const source_location& loc, const char* expression, + const char* message = nullptr) noexcept { - }; +#ifndef DEBUG_ASSERT_NO_STDIO + if (*expression == '\0') + { + if (message) + ::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached - %s.\n", + loc.file_name, loc.line_number, message); + else + ::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached.\n", + loc.file_name, loc.line_number); + } + else if (message) + ::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed - %s.\n", loc.file_name, + loc.line_number, expression, message); + else + ::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed.\n", loc.file_name, + loc.line_number, expression); +#else + (void)loc; + (void)expression; + (void)message; +#endif + } +}; - /// Helper class that sets a certain level. - /// Inherit from it in your module handler. - template - struct set_level +/// \exclude +namespace detail +{ + //=== boilerplate ===// + // from http://en.cppreference.com/w/cpp/types/remove_reference + template + struct remove_reference { - static const unsigned level = Level; + using type = T; }; - template - const unsigned set_level::level; - - /// Helper class that controls whether the handler can throw or not. - /// Inherit from it in your module handler. - /// If the module does not inherit from this class, it is assumed that - /// the handle does not throw. - struct allow_exception + template + struct remove_reference { - static const bool throwing_exception_is_allowed = true; + using type = T; }; - //=== handler ===// - /// Does not do anything to handle a failed assertion (except calling - /// [std::abort()]()). - /// Inherit from it in your module handler. - struct no_handler + template + struct remove_reference { - /// \effects Does nothing. - /// \notes Can take any additional arguments. - template - static void handle(const source_location&, const char*, Args&&...) noexcept - { - } + using type = T; }; - /// The default handler that writes a message to `stderr`. - /// Inherit from it in your module handler. - struct default_handler + // from http://stackoverflow.com/a/27501759 + template + T&& forward(typename remove_reference::type& t) { - /// \effects Prints a message to `stderr`. - /// \notes It can optionally accept an additional message string. - /// \notes If `DEBUG_ASSERT_NO_STDIO` is defined, it will do nothing. - static void handle(const source_location& loc, const char* expression, - const char* message = nullptr) noexcept - { -#ifndef DEBUG_ASSERT_NO_STDIO - if (*expression == '\0') - { - if (message) - std::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached - %s.\n", - loc.file_name, loc.line_number, message); - else - std::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached.\n", - loc.file_name, loc.line_number); - } - else if (message) - std::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed - %s.\n", - loc.file_name, loc.line_number, expression, message); - else - std::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed.\n", - loc.file_name, loc.line_number, expression); -#else - (void)loc; - (void)expression; - (void)message; -#endif - } - }; + return static_cast(t); + } - /// \exclude - namespace detail + template + T&& forward(typename remove_reference::type&& t) { - //=== boilerplate ===// - // from http://en.cppreference.com/w/cpp/types/remove_reference - template - struct remove_reference - { - using type = T; - }; + return static_cast(t); + } - template - struct remove_reference - { - using type = T; - }; + template + struct enable_if; - template - struct remove_reference - { - using type = T; - }; + template + struct enable_if + { + using type = T; + }; - // from http://stackoverflow.com/a/27501759 - template - T&& forward(typename remove_reference::type& t) - { - return static_cast(t); - } + template + struct enable_if + {}; - template - T&& forward(typename remove_reference::type&& t) - { - return static_cast(t); - } + //=== helper class to check if throw is allowed ===// + template + struct allows_exception + { + static const bool value = false; + }; - template - struct enable_if; + template + struct allows_exception::type> + { + static const bool value = Handler::throwing_exception_is_allowed; + }; - template - struct enable_if - { - using type = T; - }; + //=== regular void fake ===// + struct regular_void + { + constexpr regular_void() = default; + // enable conversion to anything + // conversion must not actually be used template - struct enable_if + constexpr operator T&() const noexcept { - }; - - //=== helper class to check if throw is allowed ===// - template - struct allows_exception - { - static const bool value = false; - }; - - template - struct allows_exception::type> - { - static const bool value = Handler::throwing_exception_is_allowed; - }; - - //=== regular void fake ===// - struct regular_void - { - constexpr regular_void() = default; - - // enable conversion to anything - // conversion must not actually be used - template - constexpr operator T&() const noexcept - { - // doesn't matter how to get the T - return DEBUG_ASSERT_MARK_UNREACHABLE, *static_cast(nullptr); - } - }; - - //=== assert implementation ===// - // function name will be shown on constexpr assertion failure - template - regular_void debug_assertion_failed(const source_location& loc, const char* expression, - Args&&... args) - { - return Handler::handle(loc, expression, detail::forward(args)...), std::abort(), - regular_void(); + // doesn't matter how to get the T + return DEBUG_ASSERT_MARK_UNREACHABLE, *static_cast(nullptr); } + }; - // use enable if instead of tag dispatching - // this removes on additional function and encourage optimization - template - constexpr auto do_assert( - const Expr& expr, const source_location& loc, const char* expression, Handler, - level, - Args&&... args) noexcept(!allows_exception::value - || noexcept(Handler::handle(loc, expression, - detail::forward(args)...))) - -> typename enable_if::type - { - static_assert(Level > 0, "level of an assertion must not be 0"); - return expr() ? regular_void() : - debug_assertion_failed(loc, expression, - detail::forward(args)...); - } + //=== assert implementation ===// + // function name will be shown on constexpr assertion failure + template + regular_void debug_assertion_failed(const source_location& loc, const char* expression, + Args&&... args) + { +#if defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable : 4702) +#endif + return Handler::handle(loc, expression, detail::forward(args)...), ::abort(), + regular_void(); +#if defined(_MSC_VER) +# pragma warning(pop) +#endif + } - template - DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, - const char*, Handler, level, - Args&&...) noexcept -> - typename enable_if<(Level > Handler::level), regular_void>::type - { - return regular_void(); - } + // use enable if instead of tag dispatching + // this removes on additional function and encourage optimization + template + constexpr auto do_assert( + const Expr& expr, const source_location& loc, const char* expression, Handler, level, + Args&&... args) noexcept(!allows_exception::value + || noexcept(Handler::handle(loc, expression, + detail::forward(args)...))) -> + typename enable_if::type + { + static_assert(Level > 0, "level of an assertion must not be 0"); + return expr() ? regular_void() + : debug_assertion_failed(loc, expression, + detail::forward(args)...); + } - template - constexpr auto do_assert( - const Expr& expr, const source_location& loc, const char* expression, Handler, - Args&&... args) noexcept(!allows_exception::value - || noexcept(Handler::handle(loc, expression, - detail::forward(args)...))) - -> typename enable_if::type - { - return expr() ? regular_void() : - debug_assertion_failed(loc, expression, - detail::forward(args)...); - } + template + DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, + const char*, Handler, level, + Args&&...) noexcept -> + typename enable_if<(Level > Handler::level), regular_void>::type + { + return regular_void(); + } - template - DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, - const char*, Handler, Args&&...) noexcept - -> typename enable_if::type - { - return regular_void(); - } + template + constexpr auto do_assert( + const Expr& expr, const source_location& loc, const char* expression, Handler, + Args&&... args) noexcept(!allows_exception::value + || noexcept(Handler::handle(loc, expression, + detail::forward(args)...))) -> + typename enable_if::type + { + return expr() ? regular_void() + : debug_assertion_failed(loc, expression, + detail::forward(args)...); + } - DEBUG_ASSERT_PURE_FUNCTION constexpr bool always_false() noexcept - { - return false; - } - } // namespace detail + template + DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, + const char*, Handler, Args&&...) noexcept -> + typename enable_if::type + { + return regular_void(); + } + + constexpr bool always_false() noexcept + { + return false; + } +} // namespace detail } // namespace debug_assert //=== assertion macros ===// @@ -329,11 +323,10 @@ namespace debug_assert /// will expand to nothing. /// This should not be necessary, the regular version is optimized away /// completely. -#define DEBUG_ASSERT(Expr, ...) \ - static_cast( \ - debug_assert::detail::do_assert([&]() \ - DEBUG_ASSERT_PURE_FUNCTION noexcept { return Expr; }, \ - DEBUG_ASSERT_CUR_SOURCE_LOCATION, #Expr, __VA_ARGS__)) +# define DEBUG_ASSERT(Expr, ...) \ + static_cast(debug_assert::detail::do_assert([&]() noexcept { return Expr; }, \ + DEBUG_ASSERT_CUR_SOURCE_LOCATION, #Expr, \ + __VA_ARGS__)) /// Marks a branch as unreachable. /// @@ -364,13 +357,14 @@ namespace debug_assert /// will expand to `DEBUG_ASSERT_MARK_UNREACHABLE`. /// This should not be necessary, the regular version is optimized away /// completely. -#define DEBUG_UNREACHABLE(...) \ - debug_assert::detail::do_assert(debug_assert::detail::always_false, \ - DEBUG_ASSERT_CUR_SOURCE_LOCATION, "", __VA_ARGS__) +# define DEBUG_UNREACHABLE(...) \ + debug_assert::detail::do_assert(debug_assert::detail::always_false, \ + DEBUG_ASSERT_CUR_SOURCE_LOCATION, "", __VA_ARGS__) #else -#define DEBUG_ASSERT(Expr, ...) static_cast(0) +# define DEBUG_ASSERT(Expr, ...) static_cast(0) -#define DEBUG_UNREACHABLE(...) (DEBUG_ASSERT_MARK_UNREACHABLE, debug_assert::detail::regular_void()) +# define DEBUG_UNREACHABLE(...) \ + (DEBUG_ASSERT_MARK_UNREACHABLE, debug_assert::detail::regular_void()) #endif #endif // DEBUG_ASSERT_HPP_INCLUDED diff --git a/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake b/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake index d8b0f72..8290c49 100644 --- a/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake +++ b/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake @@ -9,19 +9,19 @@ # The variable CVF_VERSION must be set before calling configure_file(). -set(PACKAGE_VERSION "1.3.1") +set(PACKAGE_VERSION "1.3.4") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - if("1.3.1" MATCHES "^([0-9]+)\\.") + if("1.3.4" MATCHES "^([0-9]+)\\.") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") endif() else() - set(CVF_VERSION_MAJOR "1.3.1") + set(CVF_VERSION_MAJOR "1.3.4") endif() if(PACKAGE_FIND_VERSION_RANGE) @@ -53,13 +53,13 @@ endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "" STREQUAL "") return() endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "") + math(EXPR installedBits " * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) endif() diff --git a/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp b/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp index 0d4ce70..25a2a28 100644 --- a/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp +++ b/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp @@ -115,6 +115,11 @@ namespace detail return flag_set_impl(int_type(0)); } + static constexpr flag_set_impl from_int(int_type intVal) + { + return flag_set_impl(int_type(intVal)); + } + explicit constexpr flag_set_impl(const Enum& e) : bits_(mask(e)) {} template explicit constexpr flag_set_impl(const flag_set_impl& other) @@ -416,6 +421,17 @@ class flag_set static_assert(flag_set_traits::value, "invalid enum for flag_set"); public: + using int_type = typename detail::flag_set_impl::int_type; + + /// \returns a flag_set based on the given integer value. + /// \requires `T` must be of the same type as `int_type`. + template + static constexpr flag_set from_int(T intVal) + { + static_assert(std::is_same::value, "invalid integer type, lossy conversion"); + return flag_set(intVal); + } + //=== constructors/assignment ===// /// \effects Creates a set where all flags are set to `0`. /// \group ctor_null @@ -609,6 +625,9 @@ class flag_set } private: + explicit constexpr flag_set(int_type rawvalue) noexcept : flags_(detail::flag_set_impl::from_int(rawvalue)) + {} + detail::flag_set_impl flags_; friend detail::get_flag_set_impl; diff --git a/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp b/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp index cd6b2dc..a6a5044 100644 --- a/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp +++ b/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp @@ -527,6 +527,20 @@ namespace detail template class function_ref; +namespace detail +{ + template + struct function_ref_trait { using type = void; }; + + template + struct function_ref_trait> + { + using type = function_ref; + + using return_type = typename type::return_type; + }; +} // namespace detail + /// A reference to a function. /// /// This is a lightweight reference to a function. @@ -549,6 +563,8 @@ template class function_ref { public: + using return_type = Return; + using signature = Return(Args...); /// \effects Creates a reference to the function specified by the function pointer. @@ -596,10 +612,15 @@ class function_ref /// unless the functor is compatible with the specified signature. /// \param 1 /// \exclude - template > + template < + typename Functor, + typename = detail::enable_function_tag, + // This overload restricts us to not directly referencing another function_ref. + typename std::enable_if::type, void>::value, int>::type = 0 + > explicit function_ref(Functor& f) : cb_(&invoke_functor) { + // Ref to this functor ::new (storage_.get()) void*(&f); } @@ -612,13 +633,20 @@ class function_ref /// `std::string`. If this signature than accepts a type `T` implicitly convertible to `const /// char*`, calling this will call the function taking `std::string`, converting `T -> /// std::string`, even though such a conversion would be ill-formed otherwise. \param 1 \exclude - template - explicit function_ref( - const function_ref& other, - typename std::enable_if::value, int>::type - = 0) - : storage_(other.storage_), cb_(other.cb_) - {} + template < + typename Functor, + // This overloading allows us to directly referencing another function_ref. + typename std::enable_if::type, void>::value, int>::type = 0, + // Requires that the signature not be consistent (if it is then the copy construct should be called). + typename std::enable_if::type, function_ref>::value, int>::type = 0, + // Of course, the return type and parameter types must be compatible. + typename = detail::enable_function_tag + > + explicit function_ref(Functor& f) : cb_(&invoke_functor) + { + // Ref to this function_ref + ::new (storage_.get()) void*(&f); + } /// \effects Rebinds the reference to the specified functor. /// \notes This assignment operator only participates in overload resolution, diff --git a/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp b/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp index 939d322..e0487b1 100644 --- a/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp +++ b/example/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp @@ -129,7 +129,7 @@ using underlying_type /// \group is_strong_typedef /// Whether a type `T` is a [ts::strong_type]() template > -struct TYPE_SAFE_MSC_EMPTY_BASES is_strong_typedef : std::false_type +struct is_strong_typedef : std::false_type {}; /// \group is_strong_typedef @@ -425,35 +425,35 @@ namespace strong_typedef_op /// \exclude #define TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(Name, Op) \ template \ - struct Name \ + struct TYPE_SAFE_MSC_EMPTY_BASES Name \ {}; \ TYPE_SAFE_DETAIL_MAKE_OP(Op, Name, StrongTypedef) \ TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND(Op## =, Name) \ template \ - struct mixed_##Name \ + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_##Name \ {}; \ TYPE_SAFE_DETAIL_MAKE_OP_MIXED(Op, mixed_##Name, StrongTypedef) \ TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name) \ template \ - struct mixed_##Name##_noncommutative \ + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_##Name##_noncommutative \ {}; \ TYPE_SAFE_DETAIL_MAKE_OP_STRONGTYPEDEF_OTHER(Op, mixed_##Name##_noncommutative, StrongTypedef) \ TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name##_noncommutative) template - struct equality_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES equality_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP(==, equality_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP(!=, equality_comparison, bool) template - struct mixed_equality_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_equality_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP_MIXED(==, mixed_equality_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP_MIXED(!=, mixed_equality_comparison, bool) template - struct relational_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES relational_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP(<, relational_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP(<=, relational_comparison, bool) @@ -461,7 +461,7 @@ namespace strong_typedef_op TYPE_SAFE_DETAIL_MAKE_OP(>=, relational_comparison, bool) template - struct mixed_relational_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_relational_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<, mixed_relational_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<=, mixed_relational_comparison, bool) @@ -475,7 +475,7 @@ namespace strong_typedef_op TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(modulo, %) template - struct explicit_bool + struct TYPE_SAFE_MSC_EMPTY_BASES explicit_bool { /// \exclude explicit constexpr operator bool() const @@ -486,7 +486,7 @@ namespace strong_typedef_op }; template - struct increment + struct TYPE_SAFE_MSC_EMPTY_BASES increment { /// \exclude TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator++() @@ -506,7 +506,7 @@ namespace strong_typedef_op }; template - struct decrement + struct TYPE_SAFE_MSC_EMPTY_BASES decrement { /// \exclude TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator--() @@ -526,7 +526,7 @@ namespace strong_typedef_op }; template - struct unary_plus + struct TYPE_SAFE_MSC_EMPTY_BASES unary_plus {}; /// \exclude @@ -543,7 +543,7 @@ namespace strong_typedef_op } template - struct unary_minus + struct TYPE_SAFE_MSC_EMPTY_BASES unary_minus {}; /// \exclude @@ -581,7 +581,7 @@ namespace strong_typedef_op {}; template - struct complement + struct TYPE_SAFE_MSC_EMPTY_BASES complement {}; /// \exclude @@ -609,7 +609,7 @@ namespace strong_typedef_op {}; template - struct bitshift + struct TYPE_SAFE_MSC_EMPTY_BASES bitshift {}; TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<<, bitshift, StrongTypedef) TYPE_SAFE_DETAIL_MAKE_OP_MIXED(>>, bitshift, StrongTypedef) @@ -618,7 +618,7 @@ namespace strong_typedef_op template - struct dereference + struct TYPE_SAFE_MSC_EMPTY_BASES dereference { /// \exclude Result& operator*() @@ -650,7 +650,7 @@ namespace strong_typedef_op }; template - struct array_subscript + struct TYPE_SAFE_MSC_EMPTY_BASES array_subscript { /// \exclude Result& operator[](const Index& i) @@ -752,7 +752,7 @@ namespace strong_typedef_op }; template - struct input_operator + struct TYPE_SAFE_MSC_EMPTY_BASES input_operator { /// \exclude template @@ -765,7 +765,7 @@ namespace strong_typedef_op }; template - struct output_operator + struct TYPE_SAFE_MSC_EMPTY_BASES output_operator { /// \exclude template diff --git a/tests/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp b/tests/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp index 787d5d7..0da8b74 100644 --- a/tests/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp +++ b/tests/vendor/cget/pkg/foonathan__debug_assert/install/include/debug_assert.hpp @@ -25,55 +25,46 @@ #ifndef DEBUG_ASSERT_HPP_INCLUDED #define DEBUG_ASSERT_HPP_INCLUDED -#include +#include #ifndef DEBUG_ASSERT_NO_STDIO -#include +# include #endif #ifndef DEBUG_ASSERT_MARK_UNREACHABLE -#ifdef __GNUC__ -#define DEBUG_ASSERT_MARK_UNREACHABLE __builtin_unreachable() -#elif defined(_MSC_VER) -#define DEBUG_ASSERT_MARK_UNREACHABLE __assume(0) -#else +# ifdef __GNUC__ +# define DEBUG_ASSERT_MARK_UNREACHABLE __builtin_unreachable() +# elif defined(_MSC_VER) +# define DEBUG_ASSERT_MARK_UNREACHABLE __assume(0) +# else /// Hint to the compiler that a code branch is unreachable. /// Define it yourself prior to including the header to override it. /// \notes This must be usable in an expression. -#define DEBUG_ASSERT_MARK_UNREACHABLE -#endif -#endif - -#ifndef DEBUG_ASSERT_PURE_FUNCTION -#ifdef __GNUC__ -#define DEBUG_ASSERT_PURE_FUNCTION __attribute__((pure)) -#else -/// Hint to the compiler that a function is pure. -#define DEBUG_ASSERT_PURE_FUNCTION -#endif +# define DEBUG_ASSERT_MARK_UNREACHABLE +# endif #endif #ifndef DEBUG_ASSERT_FORCE_INLINE -#ifdef __GNUC__ -#define DEBUG_ASSERT_FORCE_INLINE [[gnu::always_inline]] inline -#elif defined(_MSC_VER) -#define DEBUG_ASSERT_FORCE_INLINE __forceinline -#else +# ifdef __GNUC__ +# define DEBUG_ASSERT_FORCE_INLINE [[gnu::always_inline]] inline +# elif defined(_MSC_VER) +# define DEBUG_ASSERT_FORCE_INLINE __forceinline +# else /// Strong hint to the compiler to inline a function. /// Define it yourself prior to including the header to override it. -#define DEBUG_ASSERT_FORCE_INLINE inline -#endif +# define DEBUG_ASSERT_FORCE_INLINE inline +# endif #endif namespace debug_assert { - //=== source location ===// - /// Defines a location in the source code. - struct source_location - { - const char* file_name; ///< The file name. - unsigned line_number; ///< The line number. - }; +//=== source location ===// +/// Defines a location in the source code. +struct source_location +{ + const char* file_name; ///< The file name. + unsigned line_number; ///< The line number. +}; /// Expands to the current [debug_assert::source_location](). #define DEBUG_ASSERT_CUR_SOURCE_LOCATION \ @@ -82,222 +73,225 @@ namespace debug_assert __FILE__, static_cast(__LINE__) \ } - //=== level ===// - /// Tag type to indicate the level of an assertion. - template - struct level +//=== level ===// +/// Tag type to indicate the level of an assertion. +template +struct level +{}; + +/// Helper class that sets a certain level. +/// Inherit from it in your module handler. +template +struct set_level +{ + static const unsigned level = Level; +}; + +template +const unsigned set_level::level; + +/// Helper class that controls whether the handler can throw or not. +/// Inherit from it in your module handler. +/// If the module does not inherit from this class, it is assumed that +/// the handle does not throw. +struct allow_exception +{ + static const bool throwing_exception_is_allowed = true; +}; + +//=== handler ===// +/// Does not do anything to handle a failed assertion (except calling +/// [std::abort()]()). +/// Inherit from it in your module handler. +struct no_handler +{ + /// \effects Does nothing. + /// \notes Can take any additional arguments. + template + static void handle(const source_location&, const char*, Args&&...) noexcept + {} +}; + +/// The default handler that writes a message to `stderr`. +/// Inherit from it in your module handler. +struct default_handler +{ + /// \effects Prints a message to `stderr`. + /// \notes It can optionally accept an additional message string. + /// \notes If `DEBUG_ASSERT_NO_STDIO` is defined, it will do nothing. + static void handle(const source_location& loc, const char* expression, + const char* message = nullptr) noexcept { - }; +#ifndef DEBUG_ASSERT_NO_STDIO + if (*expression == '\0') + { + if (message) + ::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached - %s.\n", + loc.file_name, loc.line_number, message); + else + ::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached.\n", + loc.file_name, loc.line_number); + } + else if (message) + ::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed - %s.\n", loc.file_name, + loc.line_number, expression, message); + else + ::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed.\n", loc.file_name, + loc.line_number, expression); +#else + (void)loc; + (void)expression; + (void)message; +#endif + } +}; - /// Helper class that sets a certain level. - /// Inherit from it in your module handler. - template - struct set_level +/// \exclude +namespace detail +{ + //=== boilerplate ===// + // from http://en.cppreference.com/w/cpp/types/remove_reference + template + struct remove_reference { - static const unsigned level = Level; + using type = T; }; - template - const unsigned set_level::level; - - /// Helper class that controls whether the handler can throw or not. - /// Inherit from it in your module handler. - /// If the module does not inherit from this class, it is assumed that - /// the handle does not throw. - struct allow_exception + template + struct remove_reference { - static const bool throwing_exception_is_allowed = true; + using type = T; }; - //=== handler ===// - /// Does not do anything to handle a failed assertion (except calling - /// [std::abort()]()). - /// Inherit from it in your module handler. - struct no_handler + template + struct remove_reference { - /// \effects Does nothing. - /// \notes Can take any additional arguments. - template - static void handle(const source_location&, const char*, Args&&...) noexcept - { - } + using type = T; }; - /// The default handler that writes a message to `stderr`. - /// Inherit from it in your module handler. - struct default_handler + // from http://stackoverflow.com/a/27501759 + template + T&& forward(typename remove_reference::type& t) { - /// \effects Prints a message to `stderr`. - /// \notes It can optionally accept an additional message string. - /// \notes If `DEBUG_ASSERT_NO_STDIO` is defined, it will do nothing. - static void handle(const source_location& loc, const char* expression, - const char* message = nullptr) noexcept - { -#ifndef DEBUG_ASSERT_NO_STDIO - if (*expression == '\0') - { - if (message) - std::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached - %s.\n", - loc.file_name, loc.line_number, message); - else - std::fprintf(stderr, "[debug assert] %s:%u: Unreachable code reached.\n", - loc.file_name, loc.line_number); - } - else if (message) - std::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed - %s.\n", - loc.file_name, loc.line_number, expression, message); - else - std::fprintf(stderr, "[debug assert] %s:%u: Assertion '%s' failed.\n", - loc.file_name, loc.line_number, expression); -#else - (void)loc; - (void)expression; - (void)message; -#endif - } - }; + return static_cast(t); + } - /// \exclude - namespace detail + template + T&& forward(typename remove_reference::type&& t) { - //=== boilerplate ===// - // from http://en.cppreference.com/w/cpp/types/remove_reference - template - struct remove_reference - { - using type = T; - }; + return static_cast(t); + } - template - struct remove_reference - { - using type = T; - }; + template + struct enable_if; - template - struct remove_reference - { - using type = T; - }; + template + struct enable_if + { + using type = T; + }; - // from http://stackoverflow.com/a/27501759 - template - T&& forward(typename remove_reference::type& t) - { - return static_cast(t); - } + template + struct enable_if + {}; - template - T&& forward(typename remove_reference::type&& t) - { - return static_cast(t); - } + //=== helper class to check if throw is allowed ===// + template + struct allows_exception + { + static const bool value = false; + }; - template - struct enable_if; + template + struct allows_exception::type> + { + static const bool value = Handler::throwing_exception_is_allowed; + }; - template - struct enable_if - { - using type = T; - }; + //=== regular void fake ===// + struct regular_void + { + constexpr regular_void() = default; + // enable conversion to anything + // conversion must not actually be used template - struct enable_if + constexpr operator T&() const noexcept { - }; - - //=== helper class to check if throw is allowed ===// - template - struct allows_exception - { - static const bool value = false; - }; - - template - struct allows_exception::type> - { - static const bool value = Handler::throwing_exception_is_allowed; - }; - - //=== regular void fake ===// - struct regular_void - { - constexpr regular_void() = default; - - // enable conversion to anything - // conversion must not actually be used - template - constexpr operator T&() const noexcept - { - // doesn't matter how to get the T - return DEBUG_ASSERT_MARK_UNREACHABLE, *static_cast(nullptr); - } - }; - - //=== assert implementation ===// - // function name will be shown on constexpr assertion failure - template - regular_void debug_assertion_failed(const source_location& loc, const char* expression, - Args&&... args) - { - return Handler::handle(loc, expression, detail::forward(args)...), std::abort(), - regular_void(); + // doesn't matter how to get the T + return DEBUG_ASSERT_MARK_UNREACHABLE, *static_cast(nullptr); } + }; - // use enable if instead of tag dispatching - // this removes on additional function and encourage optimization - template - constexpr auto do_assert( - const Expr& expr, const source_location& loc, const char* expression, Handler, - level, - Args&&... args) noexcept(!allows_exception::value - || noexcept(Handler::handle(loc, expression, - detail::forward(args)...))) - -> typename enable_if::type - { - static_assert(Level > 0, "level of an assertion must not be 0"); - return expr() ? regular_void() : - debug_assertion_failed(loc, expression, - detail::forward(args)...); - } + //=== assert implementation ===// + // function name will be shown on constexpr assertion failure + template + regular_void debug_assertion_failed(const source_location& loc, const char* expression, + Args&&... args) + { +#if defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable : 4702) +#endif + return Handler::handle(loc, expression, detail::forward(args)...), ::abort(), + regular_void(); +#if defined(_MSC_VER) +# pragma warning(pop) +#endif + } - template - DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, - const char*, Handler, level, - Args&&...) noexcept -> - typename enable_if<(Level > Handler::level), regular_void>::type - { - return regular_void(); - } + // use enable if instead of tag dispatching + // this removes on additional function and encourage optimization + template + constexpr auto do_assert( + const Expr& expr, const source_location& loc, const char* expression, Handler, level, + Args&&... args) noexcept(!allows_exception::value + || noexcept(Handler::handle(loc, expression, + detail::forward(args)...))) -> + typename enable_if::type + { + static_assert(Level > 0, "level of an assertion must not be 0"); + return expr() ? regular_void() + : debug_assertion_failed(loc, expression, + detail::forward(args)...); + } - template - constexpr auto do_assert( - const Expr& expr, const source_location& loc, const char* expression, Handler, - Args&&... args) noexcept(!allows_exception::value - || noexcept(Handler::handle(loc, expression, - detail::forward(args)...))) - -> typename enable_if::type - { - return expr() ? regular_void() : - debug_assertion_failed(loc, expression, - detail::forward(args)...); - } + template + DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, + const char*, Handler, level, + Args&&...) noexcept -> + typename enable_if<(Level > Handler::level), regular_void>::type + { + return regular_void(); + } - template - DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, - const char*, Handler, Args&&...) noexcept - -> typename enable_if::type - { - return regular_void(); - } + template + constexpr auto do_assert( + const Expr& expr, const source_location& loc, const char* expression, Handler, + Args&&... args) noexcept(!allows_exception::value + || noexcept(Handler::handle(loc, expression, + detail::forward(args)...))) -> + typename enable_if::type + { + return expr() ? regular_void() + : debug_assertion_failed(loc, expression, + detail::forward(args)...); + } - DEBUG_ASSERT_PURE_FUNCTION constexpr bool always_false() noexcept - { - return false; - } - } // namespace detail + template + DEBUG_ASSERT_FORCE_INLINE constexpr auto do_assert(const Expr&, const source_location&, + const char*, Handler, Args&&...) noexcept -> + typename enable_if::type + { + return regular_void(); + } + + constexpr bool always_false() noexcept + { + return false; + } +} // namespace detail } // namespace debug_assert //=== assertion macros ===// @@ -329,11 +323,10 @@ namespace debug_assert /// will expand to nothing. /// This should not be necessary, the regular version is optimized away /// completely. -#define DEBUG_ASSERT(Expr, ...) \ - static_cast( \ - debug_assert::detail::do_assert([&]() \ - DEBUG_ASSERT_PURE_FUNCTION noexcept { return Expr; }, \ - DEBUG_ASSERT_CUR_SOURCE_LOCATION, #Expr, __VA_ARGS__)) +# define DEBUG_ASSERT(Expr, ...) \ + static_cast(debug_assert::detail::do_assert([&]() noexcept { return Expr; }, \ + DEBUG_ASSERT_CUR_SOURCE_LOCATION, #Expr, \ + __VA_ARGS__)) /// Marks a branch as unreachable. /// @@ -364,13 +357,14 @@ namespace debug_assert /// will expand to `DEBUG_ASSERT_MARK_UNREACHABLE`. /// This should not be necessary, the regular version is optimized away /// completely. -#define DEBUG_UNREACHABLE(...) \ - debug_assert::detail::do_assert(debug_assert::detail::always_false, \ - DEBUG_ASSERT_CUR_SOURCE_LOCATION, "", __VA_ARGS__) +# define DEBUG_UNREACHABLE(...) \ + debug_assert::detail::do_assert(debug_assert::detail::always_false, \ + DEBUG_ASSERT_CUR_SOURCE_LOCATION, "", __VA_ARGS__) #else -#define DEBUG_ASSERT(Expr, ...) static_cast(0) +# define DEBUG_ASSERT(Expr, ...) static_cast(0) -#define DEBUG_UNREACHABLE(...) (DEBUG_ASSERT_MARK_UNREACHABLE, debug_assert::detail::regular_void()) +# define DEBUG_UNREACHABLE(...) \ + (DEBUG_ASSERT_MARK_UNREACHABLE, debug_assert::detail::regular_void()) #endif #endif // DEBUG_ASSERT_HPP_INCLUDED diff --git a/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake b/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake index d8b0f72..8290c49 100644 --- a/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake +++ b/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-config-version.cmake @@ -9,19 +9,19 @@ # The variable CVF_VERSION must be set before calling configure_file(). -set(PACKAGE_VERSION "1.3.1") +set(PACKAGE_VERSION "1.3.4") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - if("1.3.1" MATCHES "^([0-9]+)\\.") + if("1.3.4" MATCHES "^([0-9]+)\\.") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") endif() else() - set(CVF_VERSION_MAJOR "1.3.1") + set(CVF_VERSION_MAJOR "1.3.4") endif() if(PACKAGE_FIND_VERSION_RANGE) @@ -53,13 +53,13 @@ endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "" STREQUAL "") return() endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "") + math(EXPR installedBits " * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) endif() diff --git a/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp b/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp index 0d4ce70..25a2a28 100644 --- a/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp +++ b/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/flag_set.hpp @@ -115,6 +115,11 @@ namespace detail return flag_set_impl(int_type(0)); } + static constexpr flag_set_impl from_int(int_type intVal) + { + return flag_set_impl(int_type(intVal)); + } + explicit constexpr flag_set_impl(const Enum& e) : bits_(mask(e)) {} template explicit constexpr flag_set_impl(const flag_set_impl& other) @@ -416,6 +421,17 @@ class flag_set static_assert(flag_set_traits::value, "invalid enum for flag_set"); public: + using int_type = typename detail::flag_set_impl::int_type; + + /// \returns a flag_set based on the given integer value. + /// \requires `T` must be of the same type as `int_type`. + template + static constexpr flag_set from_int(T intVal) + { + static_assert(std::is_same::value, "invalid integer type, lossy conversion"); + return flag_set(intVal); + } + //=== constructors/assignment ===// /// \effects Creates a set where all flags are set to `0`. /// \group ctor_null @@ -609,6 +625,9 @@ class flag_set } private: + explicit constexpr flag_set(int_type rawvalue) noexcept : flags_(detail::flag_set_impl::from_int(rawvalue)) + {} + detail::flag_set_impl flags_; friend detail::get_flag_set_impl; diff --git a/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp b/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp index cd6b2dc..a6a5044 100644 --- a/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp +++ b/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/reference.hpp @@ -527,6 +527,20 @@ namespace detail template class function_ref; +namespace detail +{ + template + struct function_ref_trait { using type = void; }; + + template + struct function_ref_trait> + { + using type = function_ref; + + using return_type = typename type::return_type; + }; +} // namespace detail + /// A reference to a function. /// /// This is a lightweight reference to a function. @@ -549,6 +563,8 @@ template class function_ref { public: + using return_type = Return; + using signature = Return(Args...); /// \effects Creates a reference to the function specified by the function pointer. @@ -596,10 +612,15 @@ class function_ref /// unless the functor is compatible with the specified signature. /// \param 1 /// \exclude - template > + template < + typename Functor, + typename = detail::enable_function_tag, + // This overload restricts us to not directly referencing another function_ref. + typename std::enable_if::type, void>::value, int>::type = 0 + > explicit function_ref(Functor& f) : cb_(&invoke_functor) { + // Ref to this functor ::new (storage_.get()) void*(&f); } @@ -612,13 +633,20 @@ class function_ref /// `std::string`. If this signature than accepts a type `T` implicitly convertible to `const /// char*`, calling this will call the function taking `std::string`, converting `T -> /// std::string`, even though such a conversion would be ill-formed otherwise. \param 1 \exclude - template - explicit function_ref( - const function_ref& other, - typename std::enable_if::value, int>::type - = 0) - : storage_(other.storage_), cb_(other.cb_) - {} + template < + typename Functor, + // This overloading allows us to directly referencing another function_ref. + typename std::enable_if::type, void>::value, int>::type = 0, + // Requires that the signature not be consistent (if it is then the copy construct should be called). + typename std::enable_if::type, function_ref>::value, int>::type = 0, + // Of course, the return type and parameter types must be compatible. + typename = detail::enable_function_tag + > + explicit function_ref(Functor& f) : cb_(&invoke_functor) + { + // Ref to this function_ref + ::new (storage_.get()) void*(&f); + } /// \effects Rebinds the reference to the specified functor. /// \notes This assignment operator only participates in overload resolution, diff --git a/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp b/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp index 939d322..e0487b1 100644 --- a/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp +++ b/tests/vendor/cget/pkg/foonathan__type_safe/install/include/type_safe/strong_typedef.hpp @@ -129,7 +129,7 @@ using underlying_type /// \group is_strong_typedef /// Whether a type `T` is a [ts::strong_type]() template > -struct TYPE_SAFE_MSC_EMPTY_BASES is_strong_typedef : std::false_type +struct is_strong_typedef : std::false_type {}; /// \group is_strong_typedef @@ -425,35 +425,35 @@ namespace strong_typedef_op /// \exclude #define TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(Name, Op) \ template \ - struct Name \ + struct TYPE_SAFE_MSC_EMPTY_BASES Name \ {}; \ TYPE_SAFE_DETAIL_MAKE_OP(Op, Name, StrongTypedef) \ TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND(Op## =, Name) \ template \ - struct mixed_##Name \ + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_##Name \ {}; \ TYPE_SAFE_DETAIL_MAKE_OP_MIXED(Op, mixed_##Name, StrongTypedef) \ TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name) \ template \ - struct mixed_##Name##_noncommutative \ + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_##Name##_noncommutative \ {}; \ TYPE_SAFE_DETAIL_MAKE_OP_STRONGTYPEDEF_OTHER(Op, mixed_##Name##_noncommutative, StrongTypedef) \ TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name##_noncommutative) template - struct equality_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES equality_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP(==, equality_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP(!=, equality_comparison, bool) template - struct mixed_equality_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_equality_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP_MIXED(==, mixed_equality_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP_MIXED(!=, mixed_equality_comparison, bool) template - struct relational_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES relational_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP(<, relational_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP(<=, relational_comparison, bool) @@ -461,7 +461,7 @@ namespace strong_typedef_op TYPE_SAFE_DETAIL_MAKE_OP(>=, relational_comparison, bool) template - struct mixed_relational_comparison + struct TYPE_SAFE_MSC_EMPTY_BASES mixed_relational_comparison {}; TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<, mixed_relational_comparison, bool) TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<=, mixed_relational_comparison, bool) @@ -475,7 +475,7 @@ namespace strong_typedef_op TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(modulo, %) template - struct explicit_bool + struct TYPE_SAFE_MSC_EMPTY_BASES explicit_bool { /// \exclude explicit constexpr operator bool() const @@ -486,7 +486,7 @@ namespace strong_typedef_op }; template - struct increment + struct TYPE_SAFE_MSC_EMPTY_BASES increment { /// \exclude TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator++() @@ -506,7 +506,7 @@ namespace strong_typedef_op }; template - struct decrement + struct TYPE_SAFE_MSC_EMPTY_BASES decrement { /// \exclude TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator--() @@ -526,7 +526,7 @@ namespace strong_typedef_op }; template - struct unary_plus + struct TYPE_SAFE_MSC_EMPTY_BASES unary_plus {}; /// \exclude @@ -543,7 +543,7 @@ namespace strong_typedef_op } template - struct unary_minus + struct TYPE_SAFE_MSC_EMPTY_BASES unary_minus {}; /// \exclude @@ -581,7 +581,7 @@ namespace strong_typedef_op {}; template - struct complement + struct TYPE_SAFE_MSC_EMPTY_BASES complement {}; /// \exclude @@ -609,7 +609,7 @@ namespace strong_typedef_op {}; template - struct bitshift + struct TYPE_SAFE_MSC_EMPTY_BASES bitshift {}; TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<<, bitshift, StrongTypedef) TYPE_SAFE_DETAIL_MAKE_OP_MIXED(>>, bitshift, StrongTypedef) @@ -618,7 +618,7 @@ namespace strong_typedef_op template - struct dereference + struct TYPE_SAFE_MSC_EMPTY_BASES dereference { /// \exclude Result& operator*() @@ -650,7 +650,7 @@ namespace strong_typedef_op }; template - struct array_subscript + struct TYPE_SAFE_MSC_EMPTY_BASES array_subscript { /// \exclude Result& operator[](const Index& i) @@ -752,7 +752,7 @@ namespace strong_typedef_op }; template - struct input_operator + struct TYPE_SAFE_MSC_EMPTY_BASES input_operator { /// \exclude template @@ -765,7 +765,7 @@ namespace strong_typedef_op }; template - struct output_operator + struct TYPE_SAFE_MSC_EMPTY_BASES output_operator { /// \exclude template