[Bug libstdc++/56785] std::tuple of two elements does not apply empty base class optimization when one of its elements is a std::tuple with two elements
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 17 10:22:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56785
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The solution I'm testing is to give every tuple hierarchy a distinct base
class, differentiated by an unused template argument that depends on the types
of all the elements, so the base classes can be at the same address.
The downside is this produces additional instantiations for programs using
different tuple types that have common tails, e.g. tuple<A,B,C> and
tuple<D,B,C> would no longer share any code. Those class instantiation
shouldn't generate much code, so maybe that's not an issue
More information about the Gcc-bugs
mailing list