View Full Version : Help on template function in C++

06-23-2008, 03:51 PM
Hi everyone!

Yesterday I was reading my C++ book. There I just came across with the function "template". I got the basic idea as to where to use it but got a bit confused with the syntax which was given over there. Can any one help on this. The syntax was somewhat like this:

template <class T1,class T2,class T3,........>
ReturnType FunctionName (argument1, argument2,.......,argumentN)
//Body of the function

Please explain me this.

Thanks in advance

06-23-2008, 10:39 PM
This may help you.


06-24-2008, 04:08 AM
This also informative content also help you

06-24-2008, 01:51 PM
Thanks eak for the info given by you. It was really helpful to me.

Thanks a lot.

06-30-2008, 04:45 PM
I haven't done CPP since college but it really helped me with my programing in general. I especially liked the data structures class I took.

I sometimes miss the templated classes/functions and class member function overloading that you can do in CPP.