On Thu, Apr 11, 2024 at 4:40 PM Arthur O'Dwyer via Std-Proposals <
std-proposals@lists.isocpp.org> wrote:
If you want to make a type-erased `my::Any` where one of the type-erased affordances is "any_cast to base," that's totally possible.
Basically,
any operation you can think of can be turned into an affordance and type-erased, as long as you're willing to write your own type-erased type. (Which is easy and everyone should know how to do it. :) See
"Type-erased UniquePrintable and PrintableRef" from November 2020.)
Yes, I know how to write type-erasure and I've done it several times when the occasion asked for it.
Relying on exceptions to do the cast can make this a library-only change, but is it considered acceptable?