From 065f39811fea9ad95ec72c70d6e3921eba878233 Mon Sep 17 00:00:00 2001 From: nonwill <46510529+nonwill@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:42:34 +0800 Subject: [PATCH] Add compatible function from Clipper1Lib: operator<< (#941) 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>;