I have checked out this and other similar questions, but all the answer says that I need to use a template. However, let's say I want to implement typeid(T) from the standard library for fun. How would I be able to do that?
I tried to track down the typeinfo header in libstdc++'s repository, and I think I found the code for typeinfo, but I cannot find the constructor of typeinfo that takes type as a parameter. Where is the implementation of typeinfo that takes type as a parameter, or how do I use type as a parameter, just like how typeid did it?