code_junkie

Forward Declaration of a Base Class

Nov 13th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. class B;
  2.  
  3. class A : public B
  4. {
  5.  
  6. // ...
  7. }
  8.  
  9. namespace std
  10. {
  11. class string;
  12. }
  13.  
  14. class A
  15. {
  16. string aStringToTest;
  17. }
  18.  
  19. typedef basic_string<char> string; // aproximate
  20.  
  21. template <typename T, typename U> class Test; // correct
  22. //template <typename T> class Test; // incorrect even if U has a default type
  23.  
  24. template <typename T, typename U = int> class Test {
  25. // ...
  26. };
Add Comment
Please, Sign In to add comment