@@adamnevraumont4027 For anyone as dumb as me, i translate their comment into even more easy one: std::variant has to know all the types it will contain, because we provide them in std::variant's declaration. This is a closed set. Type erasure (technique shown in vid) doesn't have to know all its types. It has to know some common operations they can perform. The first restricts types, but doesn't - operations The second restricts operations, but doesn't - types
20:30 No wonder he has no "copy" in the output if he removed it from the code :D
Isn't that "polymorphic type" precisely just a variant?
kindly answer this someone ^
It's effectively a variant which embodies a self-contained polymorphic draw function.
A variant is one of a closed set of types. This is one of an open set of types that support a particular operation.
@@adamnevraumont4027 For anyone as dumb as me, i translate their comment into even more easy one:
std::variant has to know all the types it will contain, because we provide them in std::variant's declaration. This is a closed set.
Type erasure (technique shown in vid) doesn't have to know all its types. It has to know some common operations they can perform.
The first restricts types, but doesn't - operations
The second restricts operations, but doesn't - types
this is effectively a constrained std::any -- I previously implemented Any using this form of type erasure.