Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does the compiler say a member of an enclosing class is not accessible from a nested class?

0
Posted

Why does the compiler say a member of an enclosing class is not accessible from a nested class?

0

The C++ compiler versions 5.7 and newer, in default standard mode,(-compat=5) allow nested classes to access private members of the enclosing class. Compilers prior to version 5.7 follow the standard and nested classes have no special access to the enclosing class.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123