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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to andysem from comment #3)
> Is there no way to improve standard components implementation? I'd imagine
> you could provide the new implementation in the new version inline namespace
> and still support the old ABI for backward compatibility.

To give a more complete answer: Inline namespaces don't help, that's a myth.

struct X { std::optional<bool> b; };

Now one translation unit has X using the old ABI and one has X using the new
ABI, but they're the same X. The fact that the two versions of optional are in
different namespaces is no help at all. You still have an ABI break.

We did it for std::string and it was a multi-year effort that caused disruption
across the industry. It's not worth doing that again to save a few bytes in
std::optional.

Reply via email to