We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fcb0b4a commit 370f397Copy full SHA for 370f397
1 file changed
parameter_pack/parameter_pack_helpers.hpp
@@ -15,7 +15,10 @@ namespace pack {
15
[[nodiscard]] consteval optional_consteval<size_t> index_for_type() noexcept
16
{
17
optional_consteval<size_t> index;
18
- consteval_for<0, sizeof...(Args)>([&index]<size_t I>() consteval {
+ // The explicit -> void keeps consteval_for's return-type probe (decltype on the body) from
19
+ // instantiating this body during deduction, dodging an Apple Clang bug that rejects the consteval
20
+ // calls on captured 'index' as non-constant. Not needed by GCC/MSVC; the real invocation is fine everywhere.
21
+ consteval_for<0, sizeof...(Args)>([&index]<size_t I>() consteval -> void {
22
if (!index) // The index of the first occurrence is stored
23
24
if constexpr (std::is_same_v<T, type_by_index<I, Args... >>)
0 commit comments