I have a 1 to 1 map. What\'s the best way to find keys from values,
i.e.
For examples if the map is this
KEY VALUE
a 1
b 2
c
I know this is a really old question but this codeproject article (http://www.codeproject.com/Articles/3016/An-STL-like-bidirectional-map) is a pretty good example of a bidirectional map.
This is an example program that shows how easy it is:
#pragma warning(disable:4503)
#include "bimap.h"
#include
#include
using codeproject::bimap;
int main(void)
{
bimap bm;
bm[1]="Monday";
bm[2]="Tuesday";
bm[3]="Wednesday";
bm[4]="Thursday";
bm[5]="Friday";
bm[6]="Saturday";
bm[7]="Sunday";
std::cout<<"Thursday occupies place #"<