This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/66699] Incorrect order of destruction for std::tuple elements


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]