-
Pretty neat!
Beware that put must handle duplicate insertion.
Also, cast's signature seems overkill if you aim for exact type equality. In this case, it can be simply
bool(std::type_index)
. Thevoid*
signature is only needed if you want to keep the TES' ability to downcast multiple types intoT*
. -
I was actually thinking of specializing
cast_
to allow conversion to base... not sure if that can be done yet ;-) And yes,put
is far too simple, but then again, this is a proof-of-principle working store in less than 100 lines of code...
Please register or sign in to comment