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 » what about VectorBiMap / ArrayBiMap ?
Re: what about VectorBiMap / ArrayBiMap ? [message #26425 is a reply to message #26416] Fri, 30 April 2010 14:45 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi Mindtraveller

this is actually exactly what i was adressing in
http://www.ultimatepp.org/forum/index.php?t=msg&th=5142& amp;start=0&

to return the responsibility of maintainig the hash/state of an object returned by T& Index::operator[] to the user.

say if a user modifies an element from Index (which is needed sometimes), he knows which element it was, and simply updates the internel hash ref of that object, calling SetKey(i) or sth. (analog to VectorMap::SetKey(i, key) )

add the follwing at
Index.h:127
	void     SetKey(int i)                   { hash.Set(i,hashfn(key[i])); }

	T&       operator[](int i)               { return key[i]; }


should do it. i discussed it there with mirek, he was hesitating.. which is sort of understandable, doing so, you might end up breaking consistency of Index if not carefull.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: _pick understanding
Next Topic: FileMove behaviour
Goto Forum:
  


Current Time: Wed May 22 12:28:18 CEST 2024

Total time taken to generate the page: 0.02093 seconds