Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/stdx/bitset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<elem_t>(~storage[i]);
}
return result;
}
Expand Down
13 changes: 5 additions & 8 deletions include/stdx/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,16 @@ template <typename T> constexpr auto is_ct_v<T const> = is_ct_v<T>;

#ifndef CT_WRAP
#define CT_WRAP(...) \
[&](auto f) { \
[&](auto f) constexpr { \
if constexpr (::stdx::is_ct_v<decltype(f())>) { \
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<f()>(); } or \
std::is_empty_v<decltype(f)>) { \
return ::stdx::ct<f()>(); \
} else { \
return f(); \
} \
}([&] { return __VA_ARGS__; })
}([&]() constexpr { return __VA_ARGS__; })
#endif

#ifndef CX_DETECT
Expand Down