Function template syntax - C++ basic concepts

Q.  Which one is suitable syntax for function template?
- Published on 19 Oct 15

a. template< class T> return_type Function_Name(parameters)
b. template< typename T> return_type Function_Name(parameters)
c. both a and b
d. None of these

ANSWER: both a and b
 

    Discussion

  • Nihal   -Posted on 08 Oct 15
    You can declare function template as follows. Both are true.
    • template< class T> return_type Function_Name(parameters)
    • template< typename T> return_type Function_Name(parameters)

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)