Hi there,
I'm having a little bit of a problem and hopefully some one can help me.
I have not programmed in c++ for a while so excuse me for being silly
My problem involves with me creating a template class with static inlined member functions.
E.g.
LEX_INLINE is just a typedef for __forceinline
DllExport is a typedef for __declspec( dllexport )
now for example if i try this in a different file, for example -> Helper::max(1.0 f, 2.0f)
i get compile error saying "Error 8 error C2955: 'Lex::Maths::He lper' : use of class template requires template argument list"
also i get errors for other functions saying this -> "Error 10 error C2670: 'Lex::Maths::He lper<T>::setNaN ' : the function template cannot convert parameter 1 from type"
Any ideas for this rusty programmer?
I'm having a little bit of a problem and hopefully some one can help me.
I have not programmed in c++ for a while so excuse me for being silly
My problem involves with me creating a template class with static inlined member functions.
E.g.
LEX_INLINE is just a typedef for __forceinline
DllExport is a typedef for __declspec( dllexport )
Code:
template<class T> class DllExport Helper { public: LEX_INLINE static T max(T Value1, T Value2); LEX_INLINE static void setNaN(T &Value); }; template<class T> LEX_INLINE T Helper<T>::max(T Value1, T Value2) { return (Value1 < Value2) ? Value2 : Value1; } template<class T> LEX_INLINE void Helper<T>::setNaN(T &Value) { Value = sqrt(-1.0f); }
i get compile error saying "Error 8 error C2955: 'Lex::Maths::He lper' : use of class template requires template argument list"
also i get errors for other functions saying this -> "Error 10 error C2670: 'Lex::Maths::He lper<T>::setNaN ' : the function template cannot convert parameter 1 from type"
Any ideas for this rusty programmer?
Comment