24 Sep
2009
24 Sep
'09
7:01 p.m.
Anthony Foglia wrote:
Nat Goodspeed wrote:
Forgive me if this is a stupid question, but if you don't want to compare the int, why is it part of the key at all?
He wants to compare the int upon retrieval, but it doesn't matter for insertion. But I think he'd be better off getting the map to only care about the string.
Or, even easier, make the key just the string and the value a pair of the int and the vector of classA:
typedef map
cMap;
Yes, that's what I was thinking: migrate the int from the key to the mapped_type.