For example:
struct X{ X():a{10} {} void foo() { a = 10; } private: int a; };
Why does this compile when a is not yet declared?
The compiler basically performs two passes on the definition of a class or structure. One for the structure / class to parse and process member declarations, then one pass for built-in functions.