Is there any simpler way to achieve Type-erasure with functions that return the actual type?
Is there any simpler way to achieve Type erasure with functions that return say an instance of the type. For example, one using some kind of type-erasure, there are other models with type info, but got stuck because there is no easy way to get full type name for ‘b’ boolean, ‘i’ int. Remember the end goal is using this return values to declare types or verify type declarations for member function pointers with little use of templates. Because the project should be simple to use, not cluttered with template arguments, because with templates, if a class template takes 3 type parameters and instances of this class are contained as data members in another class, imagine the mess it will have in the definition and declaration of the container object. So I am trying something like the following as in wikibooks example, and look the missing parts from the code below. Any simple way to get this working? Thank you in advance!