alls2011
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Помогите кто сможет. Есть код такой: Код: .......... template <class T, T (*FS)(const char*), const HG_String (*TS)(T)> class IE_UTILS_API HG_Numeric { public: HG_Numeric(); HG_Numeric(T); HG_Numeric(const char*); HG_Numeric(const HG_String&); HG_Numeric& operator=(T v); operator T() const; bool isSet() const; const HG_String toString() const; private: T m_num; bool m_isSet; }; .................... // // HG_Bool // typedef HG_Numeric<bool,atob, bool_to_str> HG_Bool; // // HG_Char // typedef HG_Numeric<char,atoc,char_to_str> HG_Char; // // HG_Short // typedef HG_Numeric<short,atos,short_to_str> HG_Short; // // HG_Double // double hg_atof(const char *sz); typedef HG_Numeric<double,hg_atof,double_to_str> HG_Double; ................. | Так вот ругается: hg_numeric.h(145) : error C2440: 'specialization' : cannot convert from '' to 'const class HG_String (__cdecl *)()' None of the functions with this name in scope match the target type hg_numeric.h(145) : error C2975: 'HG_Numeric' : invalid template argument for 'TS', constant expression expected hg_numeric.h(68) : see declaration of 'HG_Numeric' hg_numeric.h(153) : error C2440: 'specialization' : cannot convert from '' to ' (__cdecl *)(const char *)' None of the functions with this name in scope match the target type hg_numeric.h(153) : error C2975: 'HG_Numeric' : invalid template argument for 'FS', constant expression expected hg_numeric.h(68) : see declaration of 'HG_Numeric' hg_numeric.h(153) : error C2440: 'specialization' : cannot convert from '' to 'const class HG_String (__cdecl *)()' None of the functions with this name in scope match the target type hg_numeric.h(153) : error C2975: 'HG_Numeric' : invalid template argument for 'TS', constant expression expected hg_numeric.h(68) : see declaration of 'HG_Numeric' hg_numeric.h(161) : error C2440: 'specialization' : cannot convert from '' to ' (__cdecl *)(const char *)' None of the functions with this name in scope match the target type Компилирую в VS 6 |