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 #18059 is a reply to message #18054] Tue, 09 September 2008 08:47 Go to previous messageGo to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

So what "right", or "typical" solution of such a common problem is recommended? Just to make default constructor along with something like void Setup(.....) ?

stream % projects;

if(stream.IsLoading())
{
    for (int i=0; i<projects.GetCount(); ++i)
        projects.Setup(......);
}


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.
 
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: Thu Sep 04 00:56:17 CEST 2025

Total time taken to generate the page: 0.05253 seconds