From 8376a0ab26042fa356bfc066cbf3a975d34144f1 Mon Sep 17 00:00:00 2001 From: nonwill Date: Mon, 27 Jan 2025 08:32:29 +0800 Subject: [PATCH] Add compatible function from Clipper1Lib: operator<< Path& operator<<(Path& poly, const Point& p) Paths& operator<<(Paths& polys, const Path& p) --- CPP/Clipper2Lib/include/clipper2/clipper.core.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index ab71aeb0..da44e588 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -248,6 +248,20 @@ namespace Clipper2Lib template using Paths = std::vector>; + template + Path& operator<<(Path& poly, const Point& p) + { + poly.emplace_back(p); + return poly; + } + + template + Paths& operator<<(Paths& polys, const Path& p) + { + polys.emplace_back(p); + return polys; + } + using Path64 = Path; using PathD = Path; using Paths64 = std::vector< Path64>;