This is why you should be sparing with using-directives. You have:
using namespace std;
using namespace boost::geometry;
dragging all the names within these namespaces into the global namespace. That includes both std::distance
and boost::geometry::distance
and (judging from the error message) std::distance
was chosen as the better overload.
If you remove using namespace std;
, and qualify with std::
where necessary, then all should be fine. Alternatively, if you really want to keep the namespace pollution, then write the qualified name, boost::geometry::distance
.