17 Jul
2006
17 Jul
'06
2:12 a.m.
interesting idea having default contructor create a default object Ptr<Test> p1; // default object allocted Ptr<Test> p2(1, 'a', "hello"); Ptr<Test> p3(Ptr<Text>::Null()); // null object p1 = Ptr<Text>::Null(); // reset to null I could even consider an object that can never be null. It would work like a reference counting reference (instead of reference counting pointer). it would also be unbreakable. ie no null missuse. and then as a rule, if more flexibility is needed, then use the shared_ptr interface instead