我明白非类型模板参数应该是一个常量整数表达式。有人能解释一下为什么是这样吗?
template <std::string temp>
void foo()
{
// ...
}
我理解什么是常量积分表达式。为什么不允许像上面的代码片段中的非常量类型error C2993: 'std::string' : illegal type for non-type template parameter 'temp'.
std::string
呢?