U++ framework
Do not panic. Ask here before giving up.

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: 14291
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: Thu Oct 22 01:44:40 GMT+2 2026

Total time taken to generate the page: 0.01055 seconds