a guest Apr 17th, 2013 5 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #include <list>
- class A;
- class B
- A* a; //only this use is allowed with only a forward declaration, without the actual declaration
- //A a2; // this would require the declaration of A
- //actual declaration of class A:
- class A
- int i;
- typedef std::list<int> AiLst;
- int main()
- // using something else than declaring a pointer to A is allowed now.
- A::AiLst lst;
- A a;
- return 0;
- // this is the definition and can come later in the same translation unit.
RAW Paste Data