google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

Fix missing include #291

Closed MBkkt closed 1 year ago

MBkkt commented 1 year ago

https://github.com/google/s2geometry/blob/master/src/s2/s2polygon.cc#L1293

jmr commented 1 year ago

I'm not sure why this is using a multi_map instead of a priority_queue, but looks good for now. Thanks.

MBkkt commented 1 year ago

@jmr probably because priority_queue::top return const reference and it's cannot be used with unique_ptr.

But of course exist way to avoid this issue:

  1. std::vector + push_heap/pop_heap
  2. const_cast
jmr commented 1 year ago

That would make sense, but this was written before unique_ptr was used.