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++ 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 Go to previous messageGo to previous message
mirek is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Strange issue with VectorMap<String, String>
Next Topic: FEATURE: T* ArrayIndex::Detach(int i) AND mini fix
Goto Forum:
  


Current Time: Fri Jul 18 03:45:40 CEST 2025

Total time taken to generate the page: 0.04294 seconds