Could I know the type of template?

Jan 1, 2011 at 5:44am
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 Jan 1, 2011 at 5:45am
Jan 1, 2011 at 5:47am
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
Jan 1, 2011 at 6:29am
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++
Jan 1, 2011 at 7:35am
Topic archived. No new replies allowed.