use qrt to return source and target as const ref

This commit is contained in:
Sébastien Loriot 2012-05-09 17:09:55 +00:00
parent b9c6fd11a4
commit daca1eabbf
1 changed files with 12 additions and 25 deletions

View File

@ -74,54 +74,44 @@ public:
Segment_3(const Point_3& sp, const Point_3& ep) Segment_3(const Point_3& sp, const Point_3& ep)
: Rep(typename R::Construct_segment_3()(Return_base_tag(), sp, ep)) {} : Rep(typename R::Construct_segment_3()(Return_base_tag(), sp, ep)) {}
// FIXME TODO : Use Qrt here ! typename Qualified_result_of<typename R::Construct_source_3, Segment_3>::type
//typename Qualified_result_of<typename R::Construct_source_3, Segment_3>::type
Point_3
source() const source() const
{ {
return R_().construct_source_3_object()(*this); return R_().construct_source_3_object()(*this);
} }
//typename Qualified_result_of<typename R::Construct_target_3, Segment_3>::type typename Qualified_result_of<typename R::Construct_target_3, Segment_3>::type
Point_3
target() const target() const
{ {
return R_().construct_target_3_object()(*this); return R_().construct_target_3_object()(*this);
} }
//typename Qualified_result_of<typename R::Construct_source_3, Segment_3>::type typename Qualified_result_of<typename R::Construct_source_3, Segment_3>::type
Point_3
start() const start() const
{ {
return source(); return source();
} }
//typename Qualified_result_of<typename R::Construct_target_3, Segment_3>::type typename Qualified_result_of<typename R::Construct_target_3, Segment_3>::type
Point_3
end() const end() const
{ {
return target(); return target();
} }
//typename Qualified_result_of<typename R::Construct_min_vertex_2, Segment_2>::type typename Qualified_result_of<typename R::Construct_source_3, Segment_3>::type
Point_3
min BOOST_PREVENT_MACRO_SUBSTITUTION () const; min BOOST_PREVENT_MACRO_SUBSTITUTION () const;
//typename Qualified_result_of<typename R::Construct_max_vertex_2, Segment_2>::type typename Qualified_result_of<typename R::Construct_source_3, Segment_3>::type
Point_3
max BOOST_PREVENT_MACRO_SUBSTITUTION () const; max BOOST_PREVENT_MACRO_SUBSTITUTION () const;
//typename Qualified_result_of<typename R::Construct_vertex_2, Segment_2, int>::type typename Qualified_result_of<typename R::Construct_vertex_3, Segment_3>::type
Point_3
vertex(int i) const; vertex(int i) const;
//typename Qualified_result_of<typename R::Construct_vertex_2, Segment_2, int>::type typename Qualified_result_of<typename R::Construct_vertex_3, Segment_3>::type
Point_3
point(int i) const point(int i) const
{ return vertex(i); } { return vertex(i); }
//typename Qualified_result_of<typename R::Construct_vertex_2, Segment_2, int>::type typename Qualified_result_of<typename R::Construct_vertex_3, Segment_3>::type
Point_3
operator[](int i) const operator[](int i) const
{ return vertex(i); } { return vertex(i); }
@ -179,8 +169,7 @@ public:
template < class R_ > template < class R_ >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
//typename Qualified_result_of<typename R_::Construct_min_vertex_2, Segment_2<R_> >::type typename Qualified_result_of<typename R_::Construct_source_3, Segment_3<R_> >::type
typename R_::Point_3
Segment_3<R_>::min BOOST_PREVENT_MACRO_SUBSTITUTION () const Segment_3<R_>::min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
typename R_::Less_xyz_3 less_xyz; typename R_::Less_xyz_3 less_xyz;
@ -189,8 +178,7 @@ Segment_3<R_>::min BOOST_PREVENT_MACRO_SUBSTITUTION () const
template < class R_ > template < class R_ >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
//typename Qualified_result_of<typename R_::Construct_max_vertex_2, Segment_2<R_> >::type typename Qualified_result_of<typename R_::Construct_source_3, Segment_3<R_> >::type
typename R_::Point_3
Segment_3<R_>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const Segment_3<R_>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
typename R_::Less_xyz_3 less_xyz; typename R_::Less_xyz_3 less_xyz;
@ -199,8 +187,7 @@ Segment_3<R_>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const
template < class R_ > template < class R_ >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
//typename Qualified_result_of<typename R_::Construct_vertex_2, Segment_2<R_>, int >::type typename Qualified_result_of<typename R_::Construct_vertex_3, Segment_3<R_> >::type
typename R_::Point_3
Segment_3<R_>::vertex(int i) const Segment_3<R_>::vertex(int i) const
{ {
return (i%2 == 0) ? source() : target(); return (i%2 == 0) ? source() : target();