diff --git a/include/stdx/bitset.hpp b/include/stdx/bitset.hpp index 8115f98..38bb12d 100644 --- a/include/stdx/bitset.hpp +++ b/include/stdx/bitset.hpp @@ -372,7 +372,7 @@ class bitset { [[nodiscard]] constexpr auto operator~() const -> bitset { bitset result{}; for (auto i = std::size_t{}; i < storage_size; ++i) { - result.storage[i] = ~storage[i]; + result.storage[i] = static_cast(~storage[i]); } return result; } diff --git a/include/stdx/utility.hpp b/include/stdx/utility.hpp index fab1bbf..d040bf7 100644 --- a/include/stdx/utility.hpp +++ b/include/stdx/utility.hpp @@ -255,19 +255,16 @@ template constexpr auto is_ct_v = is_ct_v; #ifndef CT_WRAP #define CT_WRAP(...) \ - [&](auto f) { \ + [&](auto f) constexpr { \ if constexpr (::stdx::is_ct_v) { \ return f(); \ - } else if constexpr (requires { \ - ::stdx::ct<[&]() constexpr { \ - return __VA_ARGS__; \ - }()>; \ - }) { \ - return ::stdx::ct<[&]() constexpr { return __VA_ARGS__; }()>(); \ + } else if constexpr (requires { ::stdx::ct(); } or \ + std::is_empty_v) { \ + return ::stdx::ct(); \ } else { \ return f(); \ } \ - }([&] { return __VA_ARGS__; }) + }([&]() constexpr { return __VA_ARGS__; }) #endif #ifndef CX_DETECT