Я компилируюсь с GCC -STD = C ++ 17. Первый полученный класс не имеет проблем, но второй полученный класс шаблон.template
class Base {
protected:
static inline T n = 1;
};
class Derived1 : public Base {
public:
static int func() { return n; }
};
template
class Derived2 : public Base {
public:
using Base::n; // Why does commenting out break compile?
static T func() { return n; }
};
Подробнее здесь: https://stackoverflow.com/questions/795 ... mber-in-te
Мобильная версия