class HugeClass
{
public:
struct memberspace
{
int f() const { return parent.f; }
private:
friend HugeClass;
explicit memberspace(HugeClass & parent)
: parent(parent) {}
HugeClass & parent;
} memberspace;
HugeClass() : memberspace(*this), f(42) {}
private:
int f;
};
int main()
{
HugeClass c;
c.memberspace.f();
return 0;
}
Y2xhc3MgSHVnZUNsYXNzCnsKICAgIHB1YmxpYzoKCQlzdHJ1Y3QgbWVtYmVyc3BhY2UKCQl7CgkJCWludCBmKCkgY29uc3QgeyByZXR1cm4gcGFyZW50LmY7IH0KCQkJCgkJCXByaXZhdGU6CgkJCQlmcmllbmQgSHVnZUNsYXNzOwoJCQkJZXhwbGljaXQgbWVtYmVyc3BhY2UoSHVnZUNsYXNzICYgcGFyZW50KQoJCQkJOiBwYXJlbnQocGFyZW50KSB7fQoJCQkJSHVnZUNsYXNzICYgcGFyZW50OwoJCX0gbWVtYmVyc3BhY2U7CgkJCgkJSHVnZUNsYXNzKCkgOiBtZW1iZXJzcGFjZSgqdGhpcyksIGYoNDIpIHt9CgkJCglwcml2YXRlOgoJCWludCBmOwp9OwoKaW50IG1haW4oKQp7CglIdWdlQ2xhc3MgYzsKCWMubWVtYmVyc3BhY2UuZigpOwoJcmV0dXJuIDA7Cn0=