From c94c2734ae8afc7cbf489dc04a11b65805648b51 Mon Sep 17 00:00:00 2001 From: Justin B Date: Mon, 20 Apr 2026 10:37:13 -0500 Subject: [PATCH] fix: resolve ambiguous operator<< overload for point on Apple Clang 21 Apple Clang 21 strictly enforces template partial ordering, causing an ambiguity between the explicit point overload and the generic container template C. Add SFINAE to exclude point from the generic overload. --- include/mapbox/geometry_io.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mapbox/geometry_io.hpp b/include/mapbox/geometry_io.hpp index 250bfdc..4f97b38 100644 --- a/include/mapbox/geometry_io.hpp +++ b/include/mapbox/geometry_io.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace mapbox { namespace geometry { @@ -21,7 +22,8 @@ std::ostream& operator<<(std::ostream& os, const point& point) return os << '[' << point.x << ',' << point.y << ']'; } -template class C, class... Args> +template class C, class... Args, + typename std::enable_if, point>::value, int>::type = 0> std::ostream& operator<<(std::ostream& os, const C& cont) { os << '[';