The std::set_intersection algorithm forbids overlap of the input ranges with the output range, but if first1 or first2 and result would be equal, the algorithm could still work(see cppreference for possible implementation).
This would allow inplace execution without memory allocation, which is a big plus.26.8.7.4 set_intersection (wording)
replace: The resulting range does not overlap with either of the original ranges.
with: result may be equal to first1 or first2, otherwise the resulting range does not overlap with either of the original ranges.
PS: I am quite sure my statement is correct and I am not making a fool out of myself. Still confirmation of my claim would be great.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals