Open rbock opened 3 years ago
I'm inclined to believe that std::array
iterators aren't fully compatible with variadic reification code. See https://cppx.godbolt.org/z/qrh44K. That is just a hypothesis, though.
Thanks for the hint. Good to know it works with a c-style array!
The pack expansion support is being reworked quite a bit in the syntax refactor branch/it effectively replaces variadic reifiers. I expect this will be fixed when that is released, though it will look something like:
constexpr auto tuple_cat() {
constexpr auto values = std::array{reflexpr(1)};
return X{...[< values >]...};
}
That would be great! std:array is so much more convenient to pass as parameter or return from a function :-)
Hi,
I cannot seem to use variadic
valueof
in constexpr functions? The following does not compile:See: https://cppx.godbolt.org/z/q4v4s1
The compiler suggests to add
static
. But it turns out that static variables are not allowed in constexpr functions, see https://cppx.godbolt.org/z/xeP46sHowever, it seems the
consteval
restrictions that make the compiler ask forstatic
might be overly strict. When I replace the constructor, the compiler notices if the arguments do not match. So I guess it already starts evaluating the variadicvalueof
and complains merely as an afterthought, see https://cppx.godbolt.org/z/17bbqEUnfortunately (IMHO), the order of use and check have changed in the splice branch, hiding the hint that it might actually be possible?
Thanks,
Roland