I have a template member function of a class that I'm using for adding various different types to a list, with special handling and wrapping (everything ends up wrapped in a var object) for specific types:
template<typename V> const var& addvar(const V& v);
template<> const var& addvar<std::string>(const std::string& v) {/*stuff*/}
However, I'm passing around strings (well, const char arrays) like this to it:
object.addvar("lol");
Although I'm handling everything as std::strings, this pops in as some sort of const char array reference in the template parameter type deduction. So I get an error about not having a function for it, even with the above std::string specialization. I'm familiar with template array size deduction, so I'm trying to use that format to create an addvar that can handle such a thing, something like:
template<size_t N> const var& addvar<char>(const char& (&v)[N]) {/*stuff*/}
But things are going horribly with compiler errors about illegal arrays of references. This is in VC++ 2010, if there's any specific weirdness with that, but I get the feeling I'm messing up something fundamental here.