Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
キーではなくデータでstd::mapを並べ替える方法はありますか?今のところ、私のコードはこれを行うためだけにマップ全体を配列に複製します。
私が覚えている限りではstd::map、キーでソートされたアイテムを処理するイテレータを提供します。ソートされたアイテムを値で調べ、マップを引き続き使用する唯一の方法は、キーと値を逆にして、コレクション全体を別のマップに書き換えることです。
std::map