I'm trying to create a set that stores vertices where vertices are defined by this class:
Quote:
class Vertex { public: Vertex(); ~Vertex(); Vertex(double x_set, double y_set, double z_set, int bezierInd); double x,y,z; int bezierIndex; bool operator<(const Vertex& rhs); bool operator==(const Vertex& rhs); bool operator!=(const Vertex& rhs); };
I don't really know if i need a an allocator, but compile errors tell me I do. Also do I need a custom comparator? I created this one :
Quote:
struct vertexCmp { bool operator()(const Vertex& a, const Vertex& b) const { return a.bezierIndex < b.bezierIndex; } };
and I'm creating a set like this :
set<Vertex, vertexCmp> bezierPoints;