Код: Выделить всё
class A {
public:
template
void invokeUser(this Self&& self) {
self.invokeProtected();
}
};
template
class B : public Bases... {
protected:
void invokeProtected() {}
};
int main() { B{}.invokeUser(); }
< /code>
он не удается со следующей ошибкой: < /p>
error: 'invokeProtected' is a protected member of 'B'
note: in instantiation of function template specialization 'A::invokeUser'
Подробнее здесь: https://stackoverflow.com/questions/797 ... ted-member
Мобильная версия