Jonathan Coe wrote:
I'd like to propose adding the class-template `polymorphic_value` to boost.
`polymorphic_value` is designed to allow the compiler to correctly generate special member functions for classes with polymorphic components (It's `any` with an interface).
`polymorphic_value` has been proposed for standardisation in P0201 and has advanced through the Library Evolution group in Albuquerque (Nov 5-10). https://wg21.link/p0201
A working draft of the proposal and implementation can be found at https://github.com/jbcoe/polymorphic_value
I gave a presentation about polymorphic_value at C++::London here: https://skillsmatter.com/skillscasts/9539-a-polymorphic-value-type-for-c-plu...
Matt Calabrese has kindly offered to be review manager.
I endorse this submission provided that the repo submitted is organized according to Boost standards with documentation in doc/, headers in include/boost/, tests in test/. For examples of how a library directory layout looks like, you can use small Boost libraries such as f.ex. https://github.com/boostorg/assert (documentation in AsciiDoc) and https://github.com/boostorg/align (documentation in QuickBook.) I had a very similar thing (called ref<T> at the time), complete with the copier and the deleter, many years ago that I never got around to proposing. It seems to have been lost along with the Yahoo Boost group. PS. The code is fine. There's no need to reformat it.