Possible Duplicate:
Strings as template arguments?
Why the first declaration is OK but the second is not? Why std::string
is not suitable?
template <typename T, T x> struct foo { };
using namespace std;
int main()
{
foo<int, 0> f_int; // ok
foo<string, ""> f_string; // not ok
}
I get:
error: a non-type template parameter cannot have type 'std::basic_string<char>'
using clang++.