diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h index 122626550f4..91dd4e5e598 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h @@ -20,6 +20,8 @@ #include #include +#include + namespace CGAL { template < class R_ > @@ -59,6 +61,11 @@ public: return get_pointee_or_identity(base)[1]; } + template + const Point_3& get() const { + return get_pointee_or_identity(base)[i]; + } + const Point_3 & start() const; const Point_3 & end() const; @@ -210,4 +217,12 @@ collinear_has_on(const typename SegmentC3::Point_3 &p) const } //namespace CGAL +template < class R_ > +struct std::tuple_size > : std::integral_constant {}; + +template < class R_, size_t i > +struct std::tuple_element > { + using type = typename R_::Point_3; +}; + #endif // CGAL_CARTESIAN_SEGMENT_3_H diff --git a/Kernel_23/include/CGAL/Segment_3.h b/Kernel_23/include/CGAL/Segment_3.h index 61e02d657db..53bd1ac40f1 100644 --- a/Kernel_23/include/CGAL/Segment_3.h +++ b/Kernel_23/include/CGAL/Segment_3.h @@ -24,6 +24,8 @@ #include #include +#include + namespace CGAL { template @@ -94,6 +96,11 @@ public: return target(); } + template + decltype(auto) get() const { + return Rep::template get(); + } + decltype(auto) min BOOST_PREVENT_MACRO_SUBSTITUTION() const { typename R_::Less_xyz_3 less_xyz; @@ -197,4 +204,12 @@ operator>>(std::istream &is, Segment_3 &s) } //namespace CGAL +template < class R_ > +struct std::tuple_size > : std::integral_constant {}; + +template < class R_, size_t i > +struct std::tuple_element > { + using type = typename R_::Point_3; +}; + #endif // CGAL_SEGMENT_3_H