In c++, typeid
can accept the class name as the input. If I also want to implement a similar function, just like:
void func(T class)
{
std::cout<< typeid(class).name() <<std::endl;
}
What should be the T
?
Update
I am sorry for this unclearing question. And more details are provided in the following.
I want to use it as:
class A
{
};
void main()
{
func(A);
}
I want func(A)
can print the name of A just like std::cout<< typeid(A).name() <<std::endl;
.