I have one vector <known_names> and a second one <new_names>.
Both vectors are sorted and unique.
I want to find all occurrences of any *new_names where
1. if *new_names is already present in <known_names>, it should be added to a third vector <already_known_names>
2. if *new_names is not yet present, it should be added to a fourth vector <newly_added>
It has to be accomplished without nested loops, as I want to use just std:algorithm in a smart way.
I didn't find a smart combination of std:algorithms that satisfies my needs up to now.
Neither any of the remove... nor the for_each functions seem to support my needs.
Any suggestions would be highly appreciated.
btw. the lists have a lot of names. At least 100.000+.