C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Polymorphic operator new and polymorphic values

From: Hans Åberg <haberg_1_at_[hidden]>
Date: Wed, 30 Apr 2025 19:31:21 +0200
> On 30 Apr 2025, at 19:11, Ville Voutilainen <ville.voutilainen_at_[hidden]> wrote:
>
> On Wed, 30 Apr 2025 at 20:04, Hans Åberg via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>> This is a rather long video. Do you have something more succinct?
>
> A std::polymorphic<B>, when initialized with an in-place value of D,
> type-erases the D but copies of the std::polymorphic copy a D.

If that is enough for building my type val<A>, that is all I need. The example you gave looks right for that purpose.

Received on 2025-04-30 17:31:40