class A {
public:
class B {public: bool value;};
A() {}
B b_;
void DoStuff(B& b);
private:
virtual void DoStuffImpl(B& b) = 0;
};
class X : public A {
public:
X() {}
void Trigger();
private:
virtual void DoStuffImpl(B& b);
};
void A::DoStuff(B& b) {
DoStuffImpl(b);
}
void X::Trigger() {
DoStuff(b_);
}
void X::DoStuffImpl(B& b) {
b.value = true;
}
int main(){
X x;
x.Trigger();
//return x.b_.value;
return 0;
}
Y2xhc3MgQSB7CiBwdWJsaWM6CiAgY2xhc3MgQiB7cHVibGljOiBib29sIHZhbHVlO307CgogIEEoKSB7fQogIEIgYl87CiAgdm9pZCBEb1N0dWZmKEImIGIpOwogcHJpdmF0ZToKICB2aXJ0dWFsIHZvaWQgRG9TdHVmZkltcGwoQiYgYikgPSAwOwp9OwoKY2xhc3MgWCA6IHB1YmxpYyBBIHsKIHB1YmxpYzoKICBYKCkge30KICB2b2lkIFRyaWdnZXIoKTsKIHByaXZhdGU6CiAgdmlydHVhbCB2b2lkIERvU3R1ZmZJbXBsKEImIGIpOwp9OwoKdm9pZCBBOjpEb1N0dWZmKEImIGIpIHsKICAgICBEb1N0dWZmSW1wbChiKTsKfQoKdm9pZCBYOjpUcmlnZ2VyKCkgewogICAgRG9TdHVmZihiXyk7Cn0Kdm9pZCBYOjpEb1N0dWZmSW1wbChCJiBiKSB7CiAgICBiLnZhbHVlID0gdHJ1ZTsKfQoKaW50IG1haW4oKXsKICAgIFggeDsKICAgIHguVHJpZ2dlcigpOwogICAgLy9yZXR1cm4geC5iXy52YWx1ZTsKICAgIHJldHVybiAwOwp9