#include #include #include "util/Transform.h" #include "shapes/Sphere.h" #include "util/refptr.h" using namespace std; class S { public: S(int val) { cout << "S constructor, val " << val << endl; this->val = val; } ~S() { cout << "S destructor, val " << val << endl; } int val; }; int main() { S * a = new S(42); S * b = new S(33); cout << "a: " << a << endl; cout << "b: " << b << endl; cout << "Creating arp" << endl; refptr arp(a); cout << "Creating brp" << endl; refptr brp(b); cout << "Going to assign brp to arp" << endl; arp = brp; cout << "ok, exiting" << endl; return 0; }