Returning object of class template from insides its own function

  c++, class, templates

I have to add elements of objects of two classes. I have a template of class defined in header file as follows

template <class T>
class Test {
.
.
Test<T> add(Test<T> other)
.
}

In CPP file:
When I am implementing the above function

template <class T>
Test<T> Test<T>::add(Test<T> other) {
   Test<T> object >>> this object will hold addition of current class object and other class object
}

But I am getting error when I am doing Test object

Source: Windows Questions C++

LEAVE A COMMENT