Home » U++ Library support » U++ Core » container.At(not_existed_item_index)
container.At(not_existed_item_index) [message #3527] |
Wed, 31 May 2006 10:46 |
qwerty
Messages: 130 Registered: May 2006
|
Experienced Member |
|
|
...what is "default constructed" value for item inside container, where I getting value w/ .At and there is not such a value / that index ?
I guess, its constructor like thong, but generic types(int, double...)?
parsed through code(in rush), not found...
thanx
|
|
|
Re: container.At(not_existed_item_index) [message #3528 is a reply to message #3527] |
Wed, 31 May 2006 11:15 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
qwerty wrote on Wed, 31 May 2006 04:46 | ...what is "default constructed" value for item inside container, where I getting value w/ .At and there is not such a value / that index ?
I guess, its constructor like thong, but generic types(int, double...)?
parsed through code(in rush), not found...
thanx
|
A good question. I guess this needs discussion / better documentation.
Right now, int, double etc... are left uninitialized, whereas for types with constructor default constructor is used. I guess this is faster and you can always specify "init".
It is true that this is unsimiliar to STL, where quite often fundamental types are zeroed using the T() "constructor". Frankly, this C++ feature is something I never really liked...
Mirek
|
|
|
|
|
|
|
|
|
Re: container.At(not_existed_item_index) [message #3540 is a reply to message #3527] |
Wed, 31 May 2006 17:36 |
qwerty
Messages: 130 Registered: May 2006
|
Experienced Member |
|
|
so do I, thank you for your response...
...to be complete, is there any other way, than for(...) to traverze throught container in conjunction with possibility of modifying container during traversing ?
it's something like foreach, I guess, but there's nothing too much to add...
[Updated on: Wed, 31 May 2006 17:40] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Wed May 08 05:46:51 CEST 2024
Total time taken to generate the page: 0.02346 seconds
|