Now that C++26 has std::polymorphic<Base, Allocator>, SG14 should have inplace_polymorphic<Base, Cap, Align, Allocator>.
The reference implementation of polymorphic is here (MIT-licensed): https://github.com/jbcoe/value_types
inplace_polymorphic should use allocator_traits<Allocator>::construct to construct its value, in the same way that sg14::inplace_vector<T, Cap, Allocator> uses allocator_traits<Allocator>::construct to construct its elements. (Of course neither one ever calls allocator_traits<Allocator>::allocate.)
Now that C++26 has
std::polymorphic<Base, Allocator>, SG14 should haveinplace_polymorphic<Base, Cap, Align, Allocator>.The reference implementation of
polymorphicis here (MIT-licensed): https://github.com/jbcoe/value_typesinplace_polymorphicshould useallocator_traits<Allocator>::constructto construct its value, in the same way thatsg14::inplace_vector<T, Cap, Allocator>usesallocator_traits<Allocator>::constructto construct its elements. (Of course neither one ever callsallocator_traits<Allocator>::allocate.)