i'm not really sure if this does what you need, since I've never used it yet.. but there's a function called set_difference in the STL (it requires that you include <algorithm>).

You might want to try that.

also unique is said to eleminate duplicate copies from a range, so that might be of use too?

Good luck, and someone else prolly has a better view on this point.