Fix compilation failure with Boost 1.90.0#11
Conversation
Co-authored-by: lixun910 <2423887+lixun910@users.noreply.github.com>
Co-authored-by: lixun910 <2423887+lixun910@users.noreply.github.com>
Co-authored-by: lixun910 <2423887+lixun910@users.noreply.github.com>
| #include <boost/geometry.hpp> | ||
| #include <boost/geometry/geometries/point_xy.hpp> | ||
| #include <boost/geometry/geometries/polygon.hpp> | ||
| #include <boost/geometry/geometries/multi_point.hpp> |
There was a problem hiding this comment.
why do you add new include here?
There was a problem hiding this comment.
spatial_validation.cpp uses bg::model::multi_point on line 436 but was relying on transitive includes from <boost/geometry.hpp>. In Boost 1.90.0, the main header may not transitively include all geometry types, so I added the explicit include to ensure the code compiles with both old and new Boost versions.
| #include <boost/geometry.hpp> | ||
| #include <boost/geometry/geometries/point_xy.hpp> | ||
| #include <boost/geometry/geometries/polygon.hpp> | ||
| #include <boost/geometry/multi/geometries/multi_point.hpp> |
There was a problem hiding this comment.
why just remove the include? should #include <boost/geometry/geometries/multi_point.hpp> be added here?
There was a problem hiding this comment.
VoronoiUtils.cpp doesn't actually use any multi_point types in its code, so the include was unnecessary and could be safely removed. The old include path was causing the compilation failure, but since the file doesn't use multi_point, adding the new path would just add an unused header.
Boost 1.90.0 reorganized geometry headers, moving
multi_point.hppfromboost/geometry/multi/geometries/toboost/geometry/geometries/. This broke compilation on Alpine Linux and other platforms using BH 1.90.0.Changes
<boost/geometry/multi/geometries/multi_point.hpp>include (file doesn't use multi_point types)<boost/geometry/geometries/multi_point.hpp>include using new path (file usesbg::model::multi_pointbut relied on transitive includes)Changes are backward compatible—the new header path exists in older Boost versions.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.