trouble inserting a struct into a set C++

后端 未结 3 2212
南方客
南方客 2021-01-16 23:49

I am working on an A* pathfinding algorithm, but am having trouble with an error I receive when i insert a struct called node into a set. The error reads: \"Error 1 erro

3条回答
  •  耶瑟儿~
    2021-01-17 00:07

    std::set is an ordered container so it needs operator< to compare and order elements, allowing fast search. If you don't need this you can use list or vector.

提交回复
热议问题