>Is there a (builtin) way to compare the contents of two stl maps?
Have you tried the relational operators? Or did you just come running here before attempting anything so that you could waste time waiting for an answer?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Go to google, type in "compare C++ maps", and press the I'm Feeling Lucky button.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Then be more specific. Which of the following do you want to do:
1. Find all the x in S that are not in T.
2. Find all the x in S or T that are not in both.
3. Find all the x that are in both S and T.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
You want the symmetric difference of the two maps. Conveniently enough, the standard library provides you with the set_symmetric_difference template function in .
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401