mardi 21 avril 2020

Not Understanding Template Error in My Code [ C++ ]

I got an error in my Code : "Nested name specifier 'Node::' for declaration does not refer into a class, class template or class template partial specialization."

I'm not understand why this error happen.Guys how can i solve this error in my C++ code and the member function must implement outside of the class.

template<typename T, typename  =typename std::enable_if<isMyType<T>::value>::type>
class Node{
  T t;
public:
  T getT();
};

template<typename T, typename  =typename std::enable_if<isMyType<T>::value>::type>
T Node<T>::getT(){
return t;
}

Aucun commentaire:

Enregistrer un commentaire