[vtkusers] MSVC error: definition of a member template function outside its class

dean.inglis at camris.ca dean.inglis at camris.ca
Tue Apr 17 16:17:57 EDT 2007


Hi,

is there a work around for the MicroSoft compiler bug
(http://support.microsoft.com/kb/241949)
that will not allow definition of a member template
function outside the class?

I have a class like vtkMath that is essentially 
a collection of useful functions:

//.h file

class MyUtilities{
public:

static template <class T> int MyFunc( T* );

};


//.cxx file
//---------------------------------------------------------------------------
template <class T> int MyUtilities::MyFunc( T* data )
{
  // do stuff with data
  return 1;
}

MS Visual Studio Express 2005 can't compile
the above code :<


thanks,
Dean




More information about the vtkusers mailing list