How do you compare associative data types?

P

person

Hi,

Is there an STL function/algorithm to compare two maps and return a map
of the differences?

I'm looking for a way to do an "exclusive or" between an old map and a
new map and then work on the differences.

Thanks,
Frank
 
B

Ben Pope

person said:
Hi,

Is there an STL function/algorithm to compare two maps and return a map
of the differences?

I'm looking for a way to do an "exclusive or" between an old map and a
new map and then work on the differences.

set_symmetric_difference?

Ben Pope
 
K

KK

Ben said:
set_symmetric_difference?

Ben Pope
I did try set_difference (not the set_symmetric_difference tough) on
maps but did not work. I dont get any compiler errors, but the final
result was wrong. I wonder why!
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

I did try set_difference (not the set_symmetric_difference tough) on
maps but did not work. I dont get any compiler errors, but the final
result was wrong. I wonder why!

set_differance only returns A - B (elements in A but not in B) but does
not take into consideration elements that are unique to B.

Erik Wikström
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top