template question

Hello Friends,
I want to ask , Can we use template functions without using any class ? If yes , how ?

thank you !
Last edited on
Yes.

http://cplusplus.com/doc/tutorial/templates/

See the "GetMin" example on that page.
The class inside the <> is just a keyword used by templates, it doesn't mean that the function can take only classes at their template parameters. For example, this would be a valid call to that function:
int a=GetMin(1.25,4);

A synonym for class in that context is typename, by the way.
Last edited on
To mischt/jayt: So you have two accounts (at least)?

To all:
jayt == mischt
He accidentally posted a response as mischt here, then deleted it and reposetd it as jayt, then deleted that post. I just happened to see it. :)
lol?
yeh helios ! I got it Thanks
Topic archived. No new replies allowed.