From 81c03407f5b332a242ecce9a923d5ce188cf0a2f Mon Sep 17 00:00:00 2001 From: wjr <1966336874@qq.com> Date: Mon, 1 Jul 2024 23:27:02 +0800 Subject: [PATCH] upd --- godbolt/wjr.hpp | 787 ++++++------------ include/wjr/assert.hpp | 9 +- include/wjr/capture_leaf.hpp | 38 +- include/wjr/compressed_pair.hpp | 23 +- include/wjr/container/generic/details.hpp | 8 +- include/wjr/math/add-impl.hpp | 20 +- include/wjr/math/add.hpp | 26 +- include/wjr/math/bit.hpp | 14 +- include/wjr/math/clz.hpp | 31 +- include/wjr/math/compare.hpp | 17 +- include/wjr/math/convert.hpp | 16 +- include/wjr/math/ctz.hpp | 27 +- include/wjr/math/div.hpp | 9 +- include/wjr/math/divider.hpp | 22 +- include/wjr/math/find.hpp | 32 +- include/wjr/math/libdivide.hpp | 38 +- include/wjr/math/mul.hpp | 28 +- include/wjr/math/negate.hpp | 2 +- include/wjr/math/not.hpp | 2 +- include/wjr/math/popcount.hpp | 4 +- include/wjr/math/prefix_xor.hpp | 2 +- include/wjr/math/replace.hpp | 4 +- include/wjr/math/set.hpp | 2 +- include/wjr/math/shift.hpp | 8 +- include/wjr/math/sub-impl.hpp | 32 +- include/wjr/math/sub.hpp | 38 +- include/wjr/math/uint128_t.hpp | 12 +- include/wjr/memory/details.hpp | 4 +- include/wjr/memory/stack_allocator.hpp | 2 +- .../wjr/preprocessor/compiler/attribute.hpp | 12 +- include/wjr/tuple.hpp | 15 +- include/wjr/x86/math/mul.hpp | 20 - include/wjr/x86/math/shift.hpp | 4 +- src/wjr/math/mul.cpp | 36 +- 34 files changed, 512 insertions(+), 832 deletions(-) diff --git a/godbolt/wjr.hpp b/godbolt/wjr.hpp index 504cefef..b238a26c 100644 --- a/godbolt/wjr.hpp +++ b/godbolt/wjr.hpp @@ -1667,7 +1667,11 @@ std::basic_ostream &__ostream_insert(std::basic_ostream &__ostream_insert(std::basic_ostream -WJR_NORETURN WJR_NOINLINE void __assert_handler(const char *expr, const char *file, - const char *func, int line, - Args &&...args) noexcept { +WJR_NOINLINE void __assert_handler(const char *expr, const char *file, const char *func, + int line, Args &&...args) noexcept { std::cerr << "Additional information: "; (void)(std::cerr << ... << std::forward(args)); std::cerr << '\n'; @@ -2520,8 +2515,8 @@ WJR_NORETURN WJR_NOINLINE void __assert_handler(const char *expr, const char *fi } /// @private -WJR_NORETURN inline void __assert_handler(const char *expr, const char *file, - const char *func, int line) noexcept { +inline void __assert_handler(const char *expr, const char *file, const char *func, + int line) noexcept { __assert_failed(expr, file, func, line); } @@ -4536,6 +4531,37 @@ struct is_compressed : std::conjunction, std::is_empty, template inline constexpr bool is_compressed_v = is_compressed::value; +/// @private +template +struct __is_tuple_like_impl : std::false_type {}; + +/// @private +template +struct __is_tuple_like_impl< + LP, RP, + std::enable_if_t && + std::tuple_size_v == tp_defer_t::value>> + : std::true_type {}; + +/** + * @brief Use template<...>typename like to like all element of LP and RP. + * + * @details For example, like is std::is_assignable, LP is std::tuple, RP is + * std::tuple. \n + * Then __is_tuple_like = std::conjunction, std::is_assignable>. + * + */ +template +struct __is_tuple_like : __is_tuple_like_impl> {}; + +/** + * @brief Value of @ref __is_tuple_like. + * + */ +template +inline constexpr bool __is_tuple_like_v = __is_tuple_like::value; + /// @private template