Is there a way to avoid sorting the map based on the key value. In fact, I want to display all the pairs in the same order in which I insert them into the map.
Why not use a vector of pairs? This will be sufficient for your requirement. I think,
, "" , , () . , - boost. multi_index. : hashed_unique ordered_unique.
hashed_unique
ordered_unique
, . , ( ), , . , .
, . std::map<> , O(lg(n)).
std::map<>
O(lg(n))
std::vector<std::pair<Key,Value>>, , , O(n) .
std::vector<std::pair<Key,Value>>
O(n)
. , . B-.
, , . , . .
, . - , , , , .