Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- using std::cout;
- class B;
- class A {
- int age;
- B foo(); // even if undefined type 'B' is used by Value, not Reference of pointer,
- // this works.
- };
- class B : public A {
- };
- B A::foo() {
- return B();
- }
- int main()
- {
- B b;
- cout << "compiled.\n";
- return 0;
- }
- /*
- Output:
- compiled.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement