This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Aug 2018 19:01:54 +0100
- Subject: Re: [PATCH] PR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment
- References: <20180817175246.GA18016@redhat.com>
On 17/08/18 18:52 +0100, Jonathan Wakely wrote:
+ // The tag parameter ensures that in nested tuples each __tuple_base
+ // is a different type and can use the empty base-class optimisation.
+ template<typename _Tag>
+ class __tuple_base
Specifically, this would fail if __tuple_base was not a class
template:
static_assert(sizeof(tuple<tuple<int>>) == sizeof(int), "");
And also:
struct empty {};
static_assert(sizeof(tuple<tuple<empty>, tuple<empty>>) == 2, "");