Home » U++ Library support » U++ Core » WHY? "Index:: and ArrayIndex::operator[]" returns const T&
Re: WHY? "Index:: and ArrayIndex::operator[]" returns const T& [message #26308 is a reply to message #26296] |
Fri, 23 April 2010 10:25   |
 |
mirek
Messages: 14266 Registered: November 2005
|
Ultimate Member |
|
|
kohait00 wrote on Thu, 22 April 2010 06:08 |
in the Map variants, one can change the key refered to an object.
|
Note "Index::Set" method.
T& operator[](int i) { return key[i]; }
This is impossible (both for Index and *Map) - after setting the key, internal structure has to be updated based on the new key.
Note that for *Map, operator[] returns the *value*, not the key.
[Updated on: Fri, 23 April 2010 10:25] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Jul 18 03:45:40 CEST 2025
Total time taken to generate the page: 0.04294 seconds
|