Why is the syntax of a template member definition written in the following way -
template <typename T>
MyList<T>::push_back(T & value) { ... }
template <typename T>
MyList<T>::push_back(T & value) { ... }
To copy to clipboard, switch view to plain text mode
and not
template <typename T>
MyList::push_back(T & value) { ... } // why can't it be MyList:: instead of MyList<T>::
template <typename T>
MyList::push_back(T & value) { ... } // why can't it be MyList:: instead of MyList<T>::
To copy to clipboard, switch view to plain text mode
Is there any reason for the usage of <T> immediately after the class name?
Thanks.
Bookmarks