Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Templates as function

template <class T>
class Number {
    ... .. ...
    // Function prototype
    T getnum();
};

// Function definition
template <class T>
T Number<T>::getNum() {
    return num;
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #Templates #function
ADD COMMENT
Topic
Name
7+2 =