All pastes #938607 Raw Edit

Mine

public cpp v1 · immutable
·published 2008-03-11 19:25 UTC
rendered paste body
#include <string>#include <iostream>using namespace std;class Thing {        static int count;public:        Thing(Thing const & t) { /* No count incr on copy constructor */ }        Thing(int i) { count = i; }        Thing() { ++count; }        void print() { cout << count << endl; }};int Thing::count = 0;void foo(Thing t = Thing()) {        t.print();}int main() {        Thing a(1);        foo();  // 2        foo();  // 3        foo(a); // 3        foo(7); // 7        foo(a); // 7        foo();  // 8        return 0;}