Home » U++ Library support » U++ Core » what about VectorBiMap / ArrayBiMap ?
what about VectorBiMap / ArrayBiMap ? [message #26407] |
Fri, 30 April 2010 09:55 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
if you have lets say VectorMap<String, String> which is kind of a dictionary map, than you can search in one direction using the Find method. but if you want to look for the key that corresponds to a value, than there is only FindIndex(), which is sort of plain compare loop. what about having a container class, that offers both directions?
const VectorMap<K, T>;
int id = VectorMap<K, T>::Find(const K & key);
int id = VectorMap<K, T>::Find(const T & t);
const K & VectorMap<K, T>::operator[] const;
K & VectorMap<K, T>::operator[];
//donno if thats possible to override like that
const K & VectorMap<K, T>::operator[] const;
K & VectorMap<K, T>::operator[];
|
|
|
Goto Forum:
Current Time: Sat May 04 12:39:56 CEST 2024
Total time taken to generate the page: 0.02131 seconds
|