This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/66699] Incorrect order of destruction for std::tuple elements
- From: "antoshkka at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Jun 2015 05:35:58 +0000
- Subject: [Bug libstdc++/66699] Incorrect order of destruction for std::tuple elements
- Auto-submitted: auto-generated
- References: <bug-66699-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66699
--- Comment #3 from Antony Polukhin <antoshkka at gmail dot com> ---
(In reply to Martin Sebor from comment #2)
> Since the layout of std::pair members is fully specified, so is the order of
> their initialization and destruction. The output of the test case reflects
> this order.
>
> The order of initialization (and destruction) of std:stuple subobjects is
> less clearly specified. At least it's not immediately obvious from my
> reading of the spec if any particular order is required.
I'm pointing out that according to Standard std::pair<First, Second> and
std::tuple<First, Second> must be similar. std::pair destruction order is fully
specified, so that order must be used by tuple too.