Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.19 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. C  : implicit linked list
  2. #include <list>
  3. class A {
  4.   int data;
  5.   static std::list<A*> glist;
  6. public:
  7.   A():data(0) {
  8.     glist.push_back(this);
  9.   }
  10.   ~A() {
  11.     glist.remove(this);
  12.   }
  13. };