I have the following instance of a class with template in main.cpp
template <class T>
T mypair<T>::getmax ()
{
T retval;
retval = a>b? a : b;
return retval;
}
mypair <int> myobject (100, 75);
I wish to have a header file that has an extern to this class instance, i.e "myobject".
How can this be achieved?
I already tried:
* extern mypair<int> myobject;
* extern template mypair<int> myobject;
* extern template class mypair<int> myobject;