HowTo sort std::map?
Here is my map: typedef std::map<int/*security id*/, PositionMonth> PortfolioMonth; where PositionMonth is a structure, ex.: struct PositionMonth { Nav::Shares shares_; Nav::Amount market_value_; PositionMonth(void) {} PositionMonth(const Nav::Amount& market_value , const Nav::Shares& shares) : market_value_(market_value) , shares_(shares) {} }; Question : how to sort std::map by second value key param (by market_value_ , let it be int)? Examples or links? PS. Boost methods not interested! PPS. I'm unable to initialise my std::map with compare functor! Thanks for help! My solution (or how I