This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Implement std::experimental::variant
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: Tim Shen <timshen at google dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, "libstdc++" <libstdc++ at gcc dot gnu dot org>, Axel Naumann <Axel dot Naumann at cern dot ch>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 8 Aug 2016 13:14:33 +0300
- Subject: Re: [Patch] Implement std::experimental::variant
- Authentication-results: sourceware.org; auth=none
- References: <CAG4ZjNnKxAhg6nNjPFZjoFji50StG9LURa_Wt=OdejLJ=NkSUw@mail.gmail.com> <20160516130235.GX27545@redhat.com> <CAG4ZjNmtU8d82oJzkxBapy8jQf2Y2re5YEjqwVFNp+4OAA3p4w@mail.gmail.com> <20160609075308.GR2629@redhat.com> <CAG4ZjNmpUmbjAYDQfVut+b=xsokJBp3maf3Vn3KZ5A0j4vO=Vg@mail.gmail.com> <CAFk2RUbrb6VJAY0ujbXDPQ0y_p4JWN7HSJBKGn+bWbxBR1Vk8A@mail.gmail.com> <CAFk2RUaeAR5H4x_z_ZNDdEbbV7+n=qC+Xm91_9SVvq3+kMTF1A@mail.gmail.com> <CAG4ZjNn76ArgbX87kwTHZXgWnKSnjQ1fYpN5LLHhsLMpWF2+Nw@mail.gmail.com> <CAFk2RUYgDWYStVgsiaP809LmK7Kk0J6iX1tv9xvTRUr2RXVcYg@mail.gmail.com> <CAG4ZjNkvdCuJMmXzvJ2FejJLAtLyUzKf6=JDRKBM2Sd2va_YFQ@mail.gmail.com> <20160805110808.GY4264@redhat.com> <CAG4ZjNnY6iveWFYtVRwW_c0mB31JmRbdzyu8o98oOaWEVsp7uA@mail.gmail.com> <CAFk2RUa-UEs8e45ZnZf-Mo5EnAgJEg8jmsPfs-nyyMOE7mFngA@mail.gmail.com>
On 7 August 2016 at 04:04, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
>> Good news! This compiles now! I learned the technique from Anthony
>> Williams's implementation, whose code also compiles, but it requires a
>> close-to-trunk gcc, which implements
>> "...for unions, at least one non-static data member is of non-volatile
>> literal type, ...".
>>
>> Also added it as a test.
>>
>> Please verify the implementation by looking at _Uninitialized and
>> _Variant_storage.
>
>
> Sounds very promising, I'll try to play with it before the end of the
> weekend. Jonathan will be on holiday
> next week so we have time before this gets committed. We might want to
> entertain the idea of running
> the tests at https://github.com/efcs/libcxx/tree/variant although that
> implementation isn't something we should
> adopt things from.
I did the playing, looks very good to me. Thanks for doing the work, Tim!
(Jonathan, ship it :) )