107
I understand that non-type template parameters should be a constant integral expression. Can someone shed light why this is so?
template <std::string temp>
void foo()
{
// ...
}
error C2993: 'std::string' : illegal type for non-type template parameter 'temp'.
I understand what a constant integral expression is. What are the reasons for not allowing non-constant types like std::string as in the above snippet ?