79360756

Date: 2025-01-16 08:03:01
Score: 0.5
Natty:
Report link

Even though from the standpoint of the official standard, the code sample is badly outdated and not written in real C++, the scope rules are used correctly in this sample. The class scope is the inner scope relative to the scope where two typedef lines define P and Q. And the inner scope, as always, hides the identical names of the outer scope. Nothing weird here — the statement “Q is no longer a type in this scope” is correct. In this inner scope, P and Q are member instance functions of X.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Sergey A Kryukov