I want to add objects so a multi-map and some should have the same key how can I get access to all the elements which the same key?
Can I do a ranged fore lope over only the specific keys or something similar?
I want to add objects so a multi-map and some should have the same key how can I get access to all the elements which the same key?
Can I do a ranged fore lope over only the specific keys or something similar?
Copyright © 2021 Jogjafile Inc.
You can use the
equal_rangemember, and wrap that in aranges::subrangeto range-for over it.When ranged-for was being proposed, it was considered to let
std::pair<iter, iter>be directly iterated over, but that was rejected as potentially dangerous.See it on coliru