code_junkie

Initializing private static members

Nov 11th, 2011
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. class foo
  2. {
  3. private:
  4. static int i;
  5. };
  6.  
  7. int foo::i = 0;
  8.  
  9. class foo
  10. {
  11. private:
  12. static int i;
  13. };
  14.  
  15. int foo::i = 0;
  16.  
  17. class foo
  18. {
  19. private:
  20. static int const i = 42;
  21. };
  22.  
  23. class foo
  24. {
  25. private:
  26. static int i;
  27. };
  28.  
  29. int foo::i = 0;
  30.  
  31. class foo
  32. {
  33. private:
  34. static int i;
  35. const static int a = 42;
  36. };
  37.  
  38. int foo::i = 0;
  39.  
  40. class A
  41. {
  42. static B b;
  43. }
  44.  
  45. __declspec(selectany) A::b;
Add Comment
Please, Sign In to add comment