Tech News
← Home  ·  All topics

Pimpl Idiom

1 GoKawiil brief on this topic

C++26 adds std::polymorphic for value-semantic polymorphic composition

A follow-up article on C++26's std::indirect feature introduces std::polymorphic, a new standard library type aimed at building composite classes that own polymorphic member objects while remaining copyable, regular values. The piece illustrates the problem using a smart-house EventLog example, showing how existing approaches like storing a base class directly, using unique_ptr, or using std::variant each fail to cleanly support an open set of event types with proper value semantics.