Could I know the type of template?

1
2
3
4
5
6
7
template<typename T>
void test()
{
 //pseudo code
 if(T == unsigned char)
 //do something
}


Do I have any way to make it?Thanks a lot
Last edited on
I see what you're trying to do, and there is a way to do it, yes, it's just quite different from what you might expect.

Google/Yahoo/Bing search term:
Template Specialization


-Albatross
Thanks a lot, it really quite different from what I expected

Actually, I learned that before but I hadn't though it could be a solution
I still have a long way to go before I could really grasp the power of C++

ps : I hope someday that kind of function I mentioned would become possible in C++
Topic archived. No new replies allowed.