C++ Logo

std-proposals

Advanced search

Re: [std-proposals] is_trivially_copyable_in_reality

From: Bo Persson <bo_at_[hidden]>
Date: Thu, 29 Jan 2026 23:05:38 +0100
On 2026-01-29 at 22:48, Frederick Virchanza Gotham via Std-Proposals wrote:
> On Thu, Jan 29, 2026 at 4:37 PM Thiago Macieira wrote:
>>
>> Right now, we don't need to do anything because no polymorphic
>> object can be trivially copied.
>
> This one can:
>
> struct Donkey final {
> ~Donkey(void) noexcept = default;
> int n;
> };
>
> Are you making a distinction between "The Standard says it cannot be
> trivially copied" and "In actual fact it cannot be trivially copied"?
> Because these are two different things. According to the Standard, no
> polymorphic object can be trivially copied. However in reality, on
> every implementations except for arm64e, the vast majority of
> polymorphic objects can be trivially copied so long as they're either
> 'final' or guaranteed to be the complete object.

So "is_often_trivially_copyable" ? Doesn't sound too useful.

Received on 2026-01-29 22:05:47