Computing.Net > Forums > Programming > How to check a type of template?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to check a type of template?

Reply to Message Icon

Name: VaN
Date: June 29, 2003 at 16:16:41 Pacific
OS: Win XP Pro SP1
CPU/Ram: Athlon 2200+
Comment:

For instance, I have a template subprogram like this:

template
void functionA
{
...
}

I have 3 different custom classes which I pass as arguments to the function above, and the function is supposed to perform slightly differently depending on what class is being passed.

I tried
if (T = = myClass)
but apparently it didn't work. While we are on it, how can I identify the data type of argument a?
Also, please don't make fun of me if this question sounds silly, I'm a beginning programmer =)

Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: VaN
Date: June 29, 2003 at 16:22:05 Pacific
Reply:

:(
It should've looked this way:

template ^ class T ^
void functionA( T & a)


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to check a type of template?

C++: How to inherit a template para www.computing.net/answers/programming/c-how-to-inherit-a-template-para/10620.html

how to find the sum of a 4 digit number www.computing.net/answers/programming/how-to-find-the-sum-of-a-4-digit-number-/1143.html

how to check batch file www.computing.net/answers/programming/how-to-check-batch-file/2856.html