C++ minimal std::any
A few days ago I wrote a simple alternative to std::any. It is heavily inspired by Sean Parent’s talk Better Code: Runtime Polymorphism.
If you don’t know what std::any is, basically it is a structure that can hold data of any type, while maintaining the value semantics.
With C++11 this is really easily done in just a few lines. I’m still unsure how and where can I use it.
// "struct object" is the magic type.
[Read More]