The definition of the class
is processed it two passes: first the member declarations are collected, including function signatures, and then the bodies of definitions are parsed.
The function body therefore has access to all member declarations, including subsequent ones, but the function prototype only sees preceding declarations.