https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62056

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Agustín Bergé from comment #0)
> The recursive implementation of `std::tuple` causes noticeable longer
> compilation times and memory usage than a non-recursive implementation
> would. Furthermore, with a max template depth of 256 (Clang's default), the
> following test case results in a compilation error when attempting to use
> `make_tuple`  with more than 17 arguments:

I'm not sure what changed but neither Clang nor GCC gives any error for the
example in comment 0, even if the tuple has more than 200 elements, and
compiles in well under a second.

The draft flat implementation stores the elements in the opposite order from
the current implementation, so would be an ABI break. I think that could be
fixed by reversing the order of the arguments in the _Tuple_impl specialization
and the index_sequence type (and that reversing could be done non-recursively
using T...[N - I]).

But I'm not sure if we need to care much about this today.

Reply via email to