Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 11398640

@User 11398640
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • I need help creating a custom 'allocator' for a STL set
    U User 11398640

    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;

    C / C++ / MFC c++ help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups