I\'m working with some binary data that I have stored in arbitrarily long arrays of unsigned ints. I\'ve found that I have some duplication of data, and am looking to igno
That should work, as Renan Greinert points out, vector<>
meets the requirements to be used as a map
key.
You also say:
I'm looking at inserting each dataset into a map before storing it, but only if it was not found in the map to start with.
That's usually not what you want to do, as that would involve doing a find()
on the map, and if not found, then doing an insert()
operation. Those two operations would essentially have to do a find twice. It is better just to try and insert the items into the map. If the key is already there, the operation will fail by definition. So your code would look like this:
#include
#include