C++ Logo

std-discussion

Advanced search

Re: Potential defect in the behaviour of the rvalue constructors for std::tuple and std::pair.

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 10 Nov 2023 21:47:04 -0500
On Fri, Nov 10, 2023 at 7:15 PM Ville Voutilainen
<ville.voutilainen_at_[hidden]> wrote:
>
> On Sat, 11 Nov 2023 at 01:53, Jason McKesson via Std-Discussion
> <std-discussion_at_[hidden]> wrote:
>
> > Yes, types like `tuple` *could* override the default behavior, but to
> > be honest, it would be kind of weird for a C++ standard library
> > aggregate type to behave so differently from a C++ language aggregate
> > type. `tuple<not_null>` should behave the same as `container`.
>
> Tuple doesn't, it does override the "default" behavior, intentionally.

It doesn't seem to. Link: https://gcc.godbolt.org/z/acrE8Mh9q

That was the behavior I was talking about.

> So do other
> library components, again intentionally. If you wish to change that,
> write papers.
> This is not an oversight, this is intentional.

Received on 2023-11-11 02:47:16