[Bug libstdc++/80187] C++ variant should be trivially copy constructible if possible

timshen at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 30 22:10:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80187

--- Comment #5 from Tim Shen <timshen at gcc dot gnu.org> ---
(In reply to Ambroz Bizjak from comment #4)
> Oh wait sorry, that doesn't solve it (yet), the variant_storage_byte would
> still have a default copy constructor that copies the byte member.

Yeah, your solution seems to move the triviality forwarding down to the
individual elements, not in the variant level. However, I'm not sure if it
helps on the forwarding itself. You may still need the 4-layer inheritance on
each byte.


More information about the Gcc-bugs mailing list