NEW: Thank you everyone who helped me with this! The answer is marked below, and I\'ve expanded on the answer with a functioning version in my question, below (q.v.):
OK, so, if you really want to template this, I think the best thing I've been able to come up with is a templated class that stores your literals, based on this discussion. Something like this:
template <typename T> class Literal;
template <> class Literal<char>
{
public:
static const char Quote = '"';
};
template <> class Literal<wchar_t>
{
public:
static const wchar_t Quote = L'"';
};
Then, you'd use Literal<CHAR_T>::Quote
in your non-specialized but templated functions. Kinda messy, I guess, but it has the benefit of leaving your function logic unduplicated and gives you templated string literals.