This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Weird (unintuitive?) behavior of std::tuple
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Alex Dubov <oakad at yahoo dot com>
- Cc: Tomasz Gajewski <tomga at wp dot pl>, Paolo Carlini <pcarlini at gmail dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 31 Oct 2010 14:51:06 +0100
- Subject: Re: Weird (unintuitive?) behavior of std::tuple
- References: <507065.80883.qm@web37606.mail.mud.yahoo.com>
On 10/31/2010 12:52 PM, Alex Dubov wrote:
> Indeed, the behavior of pair is identical (and, as such, counter-
> intuitive). pair<B, C> xx(B(), C()) won't invoke the constructors at all,
> just like tuple (but will invoke the non-default ones, if those were
> specified).
>
Did you actually try to compile the snippet I proposed? Did you pay
attention to the error message? I suspect you are still a bit confused
about the actual semantics of the line above.
Paolo.