Why are redundant scope qualifications supported by the compiler, and is it legal?

Yes, it’s allowed (§9/2):

The class-name is also inserted into the scope of the class itself; this is known as the injected-class-name. For purposes of access checking, the injected-class-name is treated as if it were a public member name.

For information about the reasoning that lead to class name inject, you might want to read N0444.

Leave a Comment