C++ Logo


Advanced search

Re: [std-proposals] Making tuple an aggregate

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Tue, 07 Jun 2022 21:11:42 +0100

What breaks by making tuple an aggregate? Would it affect ABI?

There was a good point about EBO, and I think neither `Ts... ts;` nor `[[no_unique_address]] Ts... ts;` would produce the same layout as current tuple implementations, at least on Itanium. AFAIK current implementations do make use of EBO, but they don't overlap non-empty tuple members on tail padding, while [[no_unique_address]] would do that.

Maybe it could be worked around with `[[no_unique_address]] wrapper<Ts>... ts;`, but then initialization with brace-elision can become awkward (see std::array).


On 7 June 2022 20:27:45 BST, Jason McKesson via Std-Proposals <std-proposals_at_[hidden]> wrote:
>There's one thought that immediately comes to mind: even if we can
>make parameter pack members like you want... you can't change how
>`std::tuple` works. It is going to have to be given a different name.
>Std-Proposals mailing list

Received on 2022-06-07 20:11:50