The inner class has access to all members of the outer class, but does not have an implicit reference to an instance of the parent class.
To answer your modified question:
No, you cannot access this implicit pointer. I believe that this can be done in Java, but not in C ++.
You will have to pass the object of the outer class explicitly through the constructor or some other function to achieve this.
Technically, in accordance with the C ++ 03 standard (since 11.8.1) , a nested class does NOT have special access to its encompassing class.
But there is this standard defect: openstd.org/jtc1/sc22/wg21/docs/cwg_defects.html#45 Not sure if it is closed.
Alok save
source share