Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Is there a way to fetch objects w/o default constructor?
Re: Is there a way to fetch objects w/o default constructor? [message #18064 is a reply to message #18063] Tue, 09 September 2008 09:48 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
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 Smile



Thanks. I think I`ll store these objects pointers in Ptr objects. This would at least look better than plain pointers. Rolling Eyes


That is only useful if they can get destructed while "parent" object is alive....

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Full Support for timezone/DST [FEATURE REQUEST]
Next Topic: CR visibile with notepad
Goto Forum:
  


Current Time: Mon Jul 07 10:49:26 CEST 2025

Total time taken to generate the page: 0.02921 seconds