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++ Widgets - General questions or Mixed problems » why no 'Ctrl* Ctrl::Clone() const = 0' (virtual constructor)
Re: why no 'Ctrl* Ctrl::Clone() const = 0' (virtual constructor) [message #28377 is a reply to message #28376] Tue, 31 August 2010 12:22 Go to previous messageGo to previous message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
Hi Konstantin,

Where will memory be freed? One will have to remember to free it and that's somehow against U++ rule: use pointers to point things not to manage heap.

Controls have specific methods and callbacks, so i don't see any reason to have a pointer to a Ctrl without knowing it's type (derived). It will be a "useless" Ctrl which accept sizing and positioning of it and some set/get data operations.

Depend on your usage it may be simple to create a generic Clone function not a method in Ctrl class. Ctrl is meant to be easily inherited without forcing one to overwrite(or define) unwanted methods. IMO, in case that'll be ever implemented it should be in Ctrl, with the possibility to be overwrite in derived class.

Andrei
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dockable toolbars
Next Topic: ColumnList RefreshCursor public
Goto Forum:
  


Current Time: Sun May 12 14:59:25 CEST 2024

Total time taken to generate the page: 0.02153 seconds