C++ associative containers - why doesn't the standard defines methods to exchange and replaces keys? -


i need replace specific key values, while rest of value_type left untouched. need do, copy value, erase entry , insert changed key value again. absolutely bad. need copy whole value_type twice, , deallocate/allocate again.

why standard doesn't define methods this:

// returns count of exchanged keys size_type exchange_key(key_type const& x, key_type const& y); // returns count of replaced keys size_type replace_key(key_type const& old_key, key_type const& new_key); 

is there i'm missing?

i don't why not added in first place, , understand bad. guess added felt absolutely necessary.

i think have read somewhere boost.multiindex provided ability.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -