Ryan wrote:
On Thu, Sep 24, 2009 at 11:38 AM, Anthony Foglia
mailto:AFoglia@princeton.com> wrote: Or, even easier, make the key just the string and the value a pair of the int and the vector of classA:
On Thu, Sep 24, 2009 at 12:01 PM, Nat Goodspeed
mailto:nat@lindenlab.com> wrote: Yes, that's what I was thinking: migrate the int from the key to the mapped_type.
This would indeed make the insert easier at the cost of complicating the retrieval. By making the int part of the key the retrieval is trival
m_VariableDestinations.find(std::make_pair(name, intValue));
If I was to move the int out of the pair I found that it increased the difficulty quite a bit.
My other thought is: have you looked at all at Boost Multi-Index? http://www.boost.org/doc/libs/1_40_0/libs/multi_index/doc/index.html It may be that your dual key requirements would best be met by dual indexes.