c++ - How to take a pointer to a template function specialized on a string? -
I was trying to use a set of filter function to run the appropriate periodic, based on string input. I tried using the templates to create a function for common cases, but when I try to consolidate a particular function (in a structure, in the actual application), an indicator, I'm not "type type" Error
Distributed example from a Visual C ++ 8 'console application'
template & lt; Const char * C & gt; Const char * f (zero) {Return C; } Const char * (* g) (zero) = f> "Hi" & gt; Int _tmain (int argc, _TCHAR * argv []) {return g (); }
this fails with error
error 1 error C2440: 'start': 'const char * (__ cdecl *) not changed from It can be done (zero) on the main return value, there is an error for it, but it is not that the 'return character'
The string is prohibited by the ISO standard as template-value parameter.
Comments
Post a Comment