#include <iostream>
class Base {
public:
Base(int foo_val):
foo(foo_val)
{
;
}
protected:
int getfoo() const { return foo; }
private:
const int foo;
};
class Derived : Base {
public:
Derived(): Base(10) { ; }
void Display(std::ostream& out) const {
out << getfoo();
}
};
int main() {
Derived d;
d.Display(std::cout);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQmFzZSB7CglwdWJsaWM6CgkJQmFzZShpbnQgZm9vX3ZhbCk6CgkJCWZvbyhmb29fdmFsKSAKCQl7CgkJCTsJCgkJfQoJCglwcm90ZWN0ZWQ6CgkJaW50IGdldGZvbygpIGNvbnN0IHsgcmV0dXJuIGZvbzsgfQoJCglwcml2YXRlOgoJCWNvbnN0IGludCBmb287Cn07CgpjbGFzcyBEZXJpdmVkIDogQmFzZSB7CglwdWJsaWM6CgkJRGVyaXZlZCgpOiBCYXNlKDEwKSB7IDsgfQoJCQoJCXZvaWQgRGlzcGxheShzdGQ6Om9zdHJlYW0mIG91dCkgY29uc3QgewoJCQlvdXQgPDwgZ2V0Zm9vKCk7CgkJfQp9OwoKaW50IG1haW4oKSB7CglEZXJpdmVkIGQ7CglkLkRpc3BsYXkoc3RkOjpjb3V0KTsKCXJldHVybiAwOwp9