diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h index d1cbce6aee3..50fdac8f98e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h @@ -63,42 +63,6 @@ public: }; -#ifndef CGAL_NO_OSTREAM_INSERT_SEGMENTC2 -template < class R > -std::ostream & -operator<<(std::ostream &os, const SegmentC2 &s) -{ - switch(os.iword(IO::mode)) { - case IO::ASCII : - return os << s.source() << ' ' << s.target(); - case IO::BINARY : - return os << s.source() << s.target(); - default: - return os << "SegmentC2(" << s.source() << ", " << s.target() << ")"; - } -} -#endif // CGAL_NO_OSTREAM_INSERT_SEGMENTC2 - -#ifndef CGAL_NO_ISTREAM_EXTRACT_SEGMENTC2 -template < class R > -std::istream & -operator>>(std::istream &is, SegmentC2 &s) -{ - typename R::Point_2 p, q; - - is >> p >> q; - - if (is) - s = SegmentC2(p, q); - return is; -} -#endif // CGAL_NO_ISTREAM_EXTRACT_SEGMENTC2 - - - - - - CGAL_END_NAMESPACE #endif // CGAL_CARTESIAN_SEGMENT_2_H diff --git a/Kernel_23/include/CGAL/Segment_2.h b/Kernel_23/include/CGAL/Segment_2.h index f3a313b82bf..26716501cb2 100644 --- a/Kernel_23/include/CGAL/Segment_2.h +++ b/Kernel_23/include/CGAL/Segment_2.h @@ -271,24 +271,32 @@ Segment_2::bbox() const } - -#ifndef CGAL_NO_OSTREAM_INSERT_SEGMENT_2 -template < class R> +template < class R > std::ostream & operator<<(std::ostream &os, const Segment_2 &s) { - return os << s.rep(); + switch(os.iword(IO::mode)) { + case IO::ASCII : + return os << s.source() << ' ' << s.target(); + case IO::BINARY : + return os << s.source() << s.target(); + default: + return os << "Segment_2(" << s.source() << ", " << s.target() << ")"; + } } -#endif // CGAL_NO_OSTREAM_INSERT_SEGMENT_2 -#ifndef CGAL_NO_ISTREAM_EXTRACT_SEGMENT_2 -template < class R> +template < class R > std::istream & operator>>(std::istream &is, Segment_2 &s) { - return is >> s.rep(); + typename R::Point_2 p, q; + + is >> p >> q; + + if (is) + s = Segment_2(p, q); + return is; } -#endif // CGAL_NO_ISTREAM_EXTRACT_SEGMENT_2 CGAL_END_NAMESPACE