Specialize a void function template to a const char[N]
问题 I have a templated function which I want to specialize foo to const char[N] (hardcoded strings) template<typename T> const std::string foo() ; template<typename T,int N> const std::string foo<T[N]>() { return "T[N]"; } //this doesn't work for const char[12] template<> const std::string foo<const char*>() { return "Const char"; } //this doesn't work for const char[12] template<typename T> void someother function(T obj) { string s = foo<T>(); //I want to overload when T is const chat[N] }