in this code snippet:
template<class T, int Min, int Max>
class Range
{
const T min_ = Min; // works without const
T max_ = Max;
};
I’m getting the error
non static const member in class without ctor
but this is irrelevant if I’m initializing it in a class. Should that be logged as a bug?
Yes. The implicit constructor includes those initializers, so the error doesn’t occur. §12.1/6:
and 12.6.2/8: