KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a template function: template<typename T> void foo(const T& value) { bar(value); x = -1; } I want to specialize it for a set of types: template<> void foo<char>(const char& value) { bar(value); x = 0; } template<> void foo<unsigned char>(const unsigned char& value) { bar(value); x = 1; } It works ok. When I compile this: template<> void foo<char*>(const char*& value) { bar(value); x = 2; } I get an error: error C2912: explicit specialization; 'void foo(const char *&)' is not a specialization of a function template Is it possible to specialize with char* pointer type parameter without typedef'ing it?
Tags (comma-separated)
Save Edits
Cancel