C++ Logo

std-proposals

Advanced search

Re: [std-proposals] is_trivially_copyable_in_reality

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 20 Jan 2026 22:28:02 +0000
On Tue, Jan 20, 2026 at 10:25 PM Frederick Virchanza Gotham wrote:
>
> Some algorithms can be optimised for trivially copyable types.
>
> All polymorphic classes in C++ are deemed to be "not trivially
> copyable" . . . even though the vast majority of them are.
>
> So would it make sense to have "is_trivially_copyable_in_reality"
> which will be 'true' for polymorphic types which are, in actual fact,
> trivially copyable?


By the way I do realise that the same class will be trivially copyable
on some machines but not on others -- for example all polymorphic
objects on Apple Silicon arm64e will not be trivially copyable
(because the vtable pointer has to be re-signed or re-encrypted or
whatever).

Received on 2026-01-20 22:27:07