From 3f4c1c4628af0f2d621878def5ca690bb1ecfb3c Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Fri, 12 Feb 2021 11:31:03 +0100 Subject: [PATCH] moved point/vertex/[] definitions of Segment_2/3 inside the class --- Kernel_23/include/CGAL/Segment_2.h | 32 ++++++------------------------ Kernel_23/include/CGAL/Segment_3.h | 11 ++-------- 2 files changed, 8 insertions(+), 35 deletions(-) diff --git a/Kernel_23/include/CGAL/Segment_2.h b/Kernel_23/include/CGAL/Segment_2.h index acb75fd5374..ba533d050d2 100644 --- a/Kernel_23/include/CGAL/Segment_2.h +++ b/Kernel_23/include/CGAL/Segment_2.h @@ -101,13 +101,16 @@ public: max BOOST_PREVENT_MACRO_SUBSTITUTION () const; decltype(auto) - vertex(int i) const; + vertex(int i) const + { return (i%2 == 0) ? source() : target(); } decltype(auto) - point(int i) const; + point(int i) const + { return vertex(i); } decltype(auto) - operator[](int i) const; + operator[](int i) const + { return vertex(i); } bool is_horizontal() const; bool is_vertical() const; @@ -187,29 +190,6 @@ Segment_2::max BOOST_PREVENT_MACRO_SUBSTITUTION () const return less_xy(source(),target()) ? target() : source(); } -template < class R_ > -CGAL_KERNEL_INLINE -decltype(auto) -Segment_2::vertex(int i) const -{ - return (i%2 == 0) ? source() : target(); -} - -template < class R_ > -inline -decltype(auto) -Segment_2::point(int i) const -{ - return vertex(i); -} - -template < class R_ > -inline -decltype(auto) -Segment_2::operator[](int i) const -{ - return vertex(i); -} template < class R_ > CGAL_KERNEL_INLINE diff --git a/Kernel_23/include/CGAL/Segment_3.h b/Kernel_23/include/CGAL/Segment_3.h index 9bece158b35..a15d3439874 100644 --- a/Kernel_23/include/CGAL/Segment_3.h +++ b/Kernel_23/include/CGAL/Segment_3.h @@ -99,7 +99,8 @@ public: max BOOST_PREVENT_MACRO_SUBSTITUTION () const; decltype(auto) - vertex(int i) const; + vertex(int i) const + { return (i%2 == 0) ? source() : target(); } decltype(auto) point(int i) const @@ -179,14 +180,6 @@ Segment_3::max BOOST_PREVENT_MACRO_SUBSTITUTION () const return less_xyz(source(),target()) ? target() : source(); } -template < class R_ > -CGAL_KERNEL_INLINE -decltype(auto) -Segment_3::vertex(int i) const -{ - return (i%2 == 0) ? source() : target(); -} - template < class R > std::ostream &