Trying to pass string literals as template arguments [duplicate]
This question already has an answer here: Passing a string literal as a parameter to a C++ template class 12 answers I'm trying to find a comfortable way to pass string literals as template arguments. I'm not caring about supporting the widest possible number of compilers, I'm using the latest version of g++ with --std=c++0x . I've tried a lot of possible solutions but all have disappointed me. I'm sort of giving up, but first I'd like to know why a couple of them failed. Here they are: #include <iostream> #include <string> using namespace std; struct String { char const *m_sz; constexpr