code_junkie

C++ - static variables initialisation order

Nov 11th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. class Thingy
  2. {
  3. public:
  4. Thingy(char*p) {printf(p);}
  5. };
  6.  
  7. Thingy a("A");
  8. Thingy b("B");
  9. Thingy c("C");
  10.  
  11. Thingy a __attribute__((init_priority(300))) ("A");
  12. Thingy b __attribute__((init_priority(200))) ("B");
  13. Thingy c __attribute__((init_priority(400))) ("C");
Add Comment
Please, Sign In to add comment