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 » Developing U++ » U++ Developers corner » Core chat... (reference counted pointers etc.)
Re: Core chat... [message #12392 is a reply to message #12391] Sat, 27 October 2007 14:50 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14257
Registered: November 2005
Ultimate Member
mdelfede wrote on Sat, 27 October 2007 07:06

luzr wrote on Sat, 27 October 2007 11:16



So do I, but I have already measured it Wink

And, BTW, better benchmark against Vector...

(BTW2, Array does not have that At or Add reference problem - it never invalidates references).




So I suppose your Array class is built on top of a sort of linked list... not a contiguous area, right ?



Basically *implemented* as Vector<T*>...

Quote:


p.s.: just a small question about object ownership...
When you write
a.Add(aControl);

Who has the ownership of aControl ? Array a[] or who created aControl ?



Very well, getting to the real issues Smile

If aControl is an instance of widget, such statement is simply impossible (because it requires some form of copy, which Ctrl lacks).

Quote:


In former case this :
OpenGLExample aControl;
a.Add(aControl);

Should be wrong; in the latter case this :



Yes. You cannot copy widgets.

Quote:


a.Create<OpenGLExample>();

should be wrong. As you did show the latter example on this thread, I suppose a[] has the ownership...



Yes, although the whole idea of "ownership" is a little bit moot here. The widgets is simply an element of the container, the "ownership" issue is simple and obvious...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ValueMap
Next Topic: Quick and dirty solution to .icpp problem...
Goto Forum:
  


Current Time: Sat May 10 04:54:46 CEST 2025

Total time taken to generate the page: 0.03445 seconds