If I keep the function Find() inlined, then the program compiles. Otherwise, as shown below, it does not compile.
Is it possible to separate the declaration and implementation of such:
//////////////////////////////////////////////////////////////////////////
template <class T>
class MyClass
{
public:
struct MyStruct
{
int id;
T value;
};
MyStruct *Find(int id);
private:
};
template<class T>
MyClass<T>::MyStruct *Find(int id)
{
return nullptr;
}
//////////////////////////////////////////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])
{
MyClass<int> c;
c.Find(2);
return 0;
}