The syntax for that needs to be:
template <typename T>
Set<T>::Node* Set<T>::r_add(Node *temp)
{
return temp;
}
Please note that you don't have to use Set<T>::Node*
for the argument type since the scope Set<T>
will be used for Node
at that point.
Another option is to use trailing return type. That will allow you to avoid having to type Set<T>
any more than is necessary.
template <typename T>
auto Set<T>::r_add(Node *temp) -> Node*
{
return temp;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…