>>107525360
if you really need to, a solution to that is.
// foo.h
class foo {
public:
void some_api();
private:
int some_data = 0;
class p;
};
// foo.cpp
class foo::p {
foo& self;
void update();
};
void foo::some_api() {
auto p = p{*this}; // at top of each function
p.update();
}
void foo::p::update() {
self.some_data++;
}