Mindtraveller wrote on Tue, 09 September 2008 03:38
luzr wrote on Tue, 09 September 2008 10:57
Quote:
This method has one big drawback: I can`t hold any references inside Project class because I can`t initialize them in constructor. In my previous example this means i.e. I can`t hold tabs reference inside Project which is very uncomfortable. Using simple pointer and setting it inside Setup() is no good too.
That is correct. Personally I would do this sacrifice in order to avoid "Add(new)" variant. (Well, as you might have noticed, I tend to judge the quality of code by number of new/delete statements
Thanks. I think I`ll store these objects pointers in Ptr objects. This would at least look better than plain pointers.
That is only useful if they can get destructed while "parent" object is alive....