通常のcスタイルの文字列を受け入れるテンプレート特殊化の正しい構文を取得するのに問題があります。例えば
namespace RubyUtils
{
template<class T> VALUE toValue(const T& v);
};
template<> VALUE toValue(char const* & v)
{
return toValue<string>(v);
}
その後、コールサイトで
return RubyUtils::toValue("Life the universe and everything");
エラーが発生します
unresolved external symbol "unsigned long __cdecl RubyUtils::toValue<char const [33]>(char const (&)[33])"
Cスタイルの文字列を渡すことができるように特殊化をどのように構成する必要がありますか?
更新:正しい構文template =>template<>を持つようにテンプレートの特殊化を修正しました