From faa4a11e8edfa67d37eee162e2a70c17b2bb6c48 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 26 Feb 2015 11:27:37 +0100 Subject: [PATCH] Add operator<<(ostream&, Point_d) --- .../include/CGAL/NewKernel_d/Wrapper/Point_d.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index 087e4b806b5..f206cb53971 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -20,6 +20,7 @@ #ifndef CGAL_WRAPPER_POINT_D_H #define CGAL_WRAPPER_POINT_D_H +#include #include #include #include @@ -263,6 +264,23 @@ template Point_d::Point_d(Point_d &)=default; //TODO: IO +template +std::ostream& operator <<(std::ostream& os, const Point_d& p) +{ + std::vector coords; + typename R_::Cartesian_const_iterator_d + b = p.cartesian_begin(), + e = p.cartesian_end(); + for(; b != e; ++b){ + coords.push_back(*b); + } + os << coords.size(); + for(std::size_t i=0; i < coords.size(); i++){ + os << " " << coords[i]; + } + return os << std::flush; +} + //template //Vector_d operator+(const Vector_d& v,const Vector_d& w) const //{