[Solved] Search variable/item/attribute using STL in c++?
Something along the lines of std::vector<std::pair<int, int>> find_nonmatching_values(const std::unordered_multimap<int, int> & thing, int key, int value) { std::vector<std::pair<int, int>> ret; auto range = thing.equal_range(key); std::copy_if(range.first, range.second, std::back_inserter(ret), [value](const std::pair<const int, int> &p) { return p.second != value; }); return ret; } Demo. Templatizing this code is left as an exercise for the reader. solved Search … Read more