Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct A {
- A &f() {
- return *this;
- }
- };
- struct B : A {
- void foo() {};
- };
- int main() {
- B b;
- b.f().foo();
- }
- // obvious compiler error: class 'A' has no member method named 'foo'.
- // how do I make this work?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement