V
vsgdp
I have a container of pointers. It is possible for two pointers to point to
the same element. I want to remove duplicates.
I am open to which container is best for this.
I thought of using std::set, but my elements do not have a '<' operator, as
it does not make sense. I could add an integer index to the data structure
so that each element has a unique index associated with it and then override
'<' to sort by index, but I am not sure if this is the best way.
Any advice appreciated.
the same element. I want to remove duplicates.
I am open to which container is best for this.
I thought of using std::set, but my elements do not have a '<' operator, as
it does not make sense. I could add an integer index to the data structure
so that each element has a unique index associated with it and then override
'<' to sort by index, but I am not sure if this is the best way.
Any advice appreciated.