Given two STL sets, I want to find out the XOR of them. Is there an easy, pre-existing way to do that?
+2
A:
You can use std::set_symmetric_difference
from the C++ standard library.
James McNellis
2010-07-18 17:50:38
Apparently you won the race :p
Matthieu M.
2010-07-19 06:59:51
@Matthieu: By a whopping 32 seconds! (Actually, I hadn't returned to see that two others had posted the same thing, otherwise I'd have probably deleted this :-P)
James McNellis
2010-07-19 12:20:44
+1
A:
Try std::set_symmetric_difference:
http://www.cplusplus.com/reference/algorithm/set_symmetric_difference/
George
2010-07-18 17:51:43