C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::sizeof_minus_trailing_padding

From: Breno Guimarães <brenorg_at_[hidden]>
Date: Sun, 3 Dec 2023 19:16:13 -0300
Yeah, the link only talks about empty base class optimization, but that
happens with non empty too. It should've been called "padding optimization"
or something.

Just derive a class with trailing padding and add a member that can fit in
the padding and the padding will be reused.

Em dom., 3 de dez. de 2023 18:48, Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> escreveu:

> On Sun, Dec 3, 2023 at 7:20 PM Breno Guimarãeswrote:
> >
> > By the way, the no_unique_address annotation didn't bring the concept of
> overlapping objects. It already existed.
> >
> > https://en.cppreference.com/w/cpp/language/ebo
>
>
> But people haven't been memcpy'ing and memset'ing empty base classes
> for a few decades.
>
> Bringing it in for types where people would have historically been
> using 'memset' as a bulldozer for a few decades is a much bigger deal.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-12-03 22:17:12