Date: Wed, 30 Apr 2025 20:11:47 +0300
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.
Quite like a std::function, which is also polymorphic, type-erases the
actual concrete type, but can nevertheless properly copy that concrete
type when the std::function is copied. As in https://godbolt.org/z/5Pvdf3qzY
<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.
Quite like a std::function, which is also polymorphic, type-erases the
actual concrete type, but can nevertheless properly copy that concrete
type when the std::function is copied. As in https://godbolt.org/z/5Pvdf3qzY
Received on 2025-04-30 17:12:01