From 8c20bd91c253861a60229e51f13ed9bc5a28abeb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Apr 2015 11:31:21 +0200 Subject: [PATCH] Replace CGAL::get() with CGAL::get_pointee_or_identity() and remove using get:: --- .../include/CGAL/Cartesian/Circle_2.h | 6 +++--- .../include/CGAL/Cartesian/Circle_3.h | 4 ++-- .../include/CGAL/Cartesian/Direction_2.h | 4 ++-- .../include/CGAL/Cartesian/Direction_3.h | 6 +++--- .../include/CGAL/Cartesian/Iso_cuboid_3.h | 4 ++-- .../include/CGAL/Cartesian/Iso_rectangle_2.h | 4 ++-- .../include/CGAL/Cartesian/Line_2.h | 6 +++--- .../include/CGAL/Cartesian/Line_3.h | 4 ++-- .../include/CGAL/Cartesian/Plane_3.h | 8 ++++---- .../include/CGAL/Cartesian/Ray_2.h | 4 ++-- .../include/CGAL/Cartesian/Ray_3.h | 4 ++-- .../include/CGAL/Cartesian/Segment_2.h | 4 ++-- .../include/CGAL/Cartesian/Segment_3.h | 4 ++-- .../include/CGAL/Cartesian/Sphere_3.h | 6 +++--- .../include/CGAL/Cartesian/Tetrahedron_3.h | 8 ++++---- .../include/CGAL/Cartesian/Triangle_2.h | 6 +++--- .../include/CGAL/Cartesian/Triangle_3.h | 6 +++--- .../include/CGAL/Cartesian/Vector_2.h | 8 ++++---- .../include/CGAL/Cartesian/Vector_3.h | 10 +++++----- .../CGAL/Circular_kernel_3/Circular_arc_3.h | 8 ++++---- .../Circular_kernel_3/Circular_arc_point_3.h | 10 +++++----- .../CGAL/Circular_kernel_3/Line_arc_3.h | 6 +++--- .../include/CGAL/Homogeneous/CircleH2.h | 6 +++--- .../include/CGAL/Homogeneous/DirectionH2.h | 8 ++++---- .../include/CGAL/Homogeneous/DirectionH3.h | 18 +++++++++--------- .../include/CGAL/Homogeneous/Iso_cuboidH3.h | 4 ++-- .../include/CGAL/Homogeneous/Iso_rectangleH2.h | 4 ++-- .../include/CGAL/Homogeneous/LineH2.h | 6 +++--- .../include/CGAL/Homogeneous/PlaneH3.h | 8 ++++---- .../include/CGAL/Homogeneous/RayH3.h | 6 +++--- .../include/CGAL/Homogeneous/SphereH3.h | 6 +++--- .../include/CGAL/Homogeneous/VectorH2.h | 14 +++++++------- .../include/CGAL/Homogeneous/VectorH3.h | 16 ++++++++-------- Kernel_23/include/CGAL/Ray_3.h | 2 +- .../CGAL/NewKernel_d/Wrapper/Ref_count_obj.h | 2 +- .../include/CGAL/property_map.h | 1 - STL_Extension/include/CGAL/Handle_for.h | 4 ++-- 37 files changed, 117 insertions(+), 118 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h index 3b0c9f731bc..70ccd71e23c 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h @@ -62,17 +62,17 @@ public: const Point_2 & center() const { - return get(base).template get<0>(); + return get_pointee_or_identity(base).template get<0>(); } const FT & squared_radius() const { - return get(base).template get<1>(); + return get_pointee_or_identity(base).template get<1>(); } Orientation orientation() const { - return get(base).template get<2>(); + return get_pointee_or_identity(base).template get<2>(); } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h index 5eed58713c5..f7b4a1014a4 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h @@ -126,7 +126,7 @@ public: const Plane_3& supporting_plane() const { - return get(base).second; + return get_pointee_or_identity(base).second; } const Sphere_3& supporting_sphere() const @@ -146,7 +146,7 @@ public: const Sphere_3& diametral_sphere() const { - return get(base).first; + return get_pointee_or_identity(base).first; } double approximate_area() const diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h index ba712369be6..d515825277e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h @@ -64,11 +64,11 @@ public: const RT & dx() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const RT & dy() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h index 814f54e0629..862d95be9f8 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h @@ -76,15 +76,15 @@ public: const FT & dx() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const FT & dy() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } const FT & dz() const { - return get(base)[2]; + return get_pointee_or_identity(base)[2]; } const FT & hdx() const diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h index 1cac28aaff9..634136c14d9 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h @@ -111,11 +111,11 @@ public: const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } Point_3 vertex(int i) const; Point_3 operator[](int i) const; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h index 7f2fa1da746..07544757641 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Iso_rectangle_2.h @@ -59,11 +59,11 @@ public: const Point_2 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const Point_2 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h index a8fb1c607b7..52b946a1197 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h @@ -61,15 +61,15 @@ public: const FT & a() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const FT & b() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } const FT & c() const { - return get(base)[2]; + return get_pointee_or_identity(base)[2]; } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h index 79acd831706..9a2864ad138 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Line_3.h @@ -75,12 +75,12 @@ public: const Point_3 & point() const { - return get(base).first; + return get_pointee_or_identity(base).first; } const Vector_3 & to_vector() const { - return get(base).second; + return get_pointee_or_identity(base).second; } Direction_3 direction() const diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h index 61a84c9bc8c..8b78a3ecb91 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h @@ -87,19 +87,19 @@ public: const FT & a() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const FT & b() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } const FT & c() const { - return get(base)[2]; + return get_pointee_or_identity(base)[2]; } const FT & d() const { - return get(base)[3]; + return get_pointee_or_identity(base)[3]; } Line_3 perpendicular_line(const Point_3 &p) const; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h index c42f9334676..4af8dc06f5f 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h @@ -55,13 +55,13 @@ public: const Point_2& source() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const Point_2 & second_point() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } typename R_::Boolean is_degenerate() const diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h index 224fa01e16e..7278255bb5b 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h @@ -67,11 +67,11 @@ public: const Point_3 & source() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const Point_3 & second_point() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } Point_3 point(int i) const; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h index f720455a84f..1ae21c34c09 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Segment_2.h @@ -53,13 +53,13 @@ public: const Point_2 & source() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const Point_2 & target() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h index 70244a623e3..ecf0d056b8a 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h @@ -60,11 +60,11 @@ public: const Point_3 & source() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const Point_3 & target() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } const Point_3 & start() const; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h index d59e03a7e09..cff0d0d4709 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h @@ -109,17 +109,17 @@ public: const Point_3_ & center() const { - return get(base).template get<0>(); + return get_pointee_or_identity(base).template get<0>(); } const FT & squared_radius() const { // Returns the square of the radius (instead of the radius itself, // which would require square roots) - return get(base).template get<1>(); + return get_pointee_or_identity(base).template get<1>(); } Orientation orientation() const { - return get(base).template get<2>(); + return get_pointee_or_identity(base).template get<2>(); } // A circle is degenerate if its (squared) radius is null or negative diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h index 853563727ed..654f0c2f625 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h @@ -119,10 +119,10 @@ vertex(int i) const else if (i>3) i=i%4; switch (i) { - case 0: return get(base)[0]; - case 1: return get(base)[1]; - case 2: return get(base)[2]; - default: return get(base)[3]; + case 0: return get_pointee_or_identity(base)[0]; + case 1: return get_pointee_or_identity(base)[1]; + case 2: return get_pointee_or_identity(base)[2]; + default: return get_pointee_or_identity(base)[3]; } } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h index 07bbbe03139..1a28b00f787 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_2.h @@ -57,9 +57,9 @@ public: { if (i>2) i = i%3; else if (i<0) i = (i%3) + 3; - return (i==0) ? get(base)[0] : - (i==1) ? get(base)[1] : - get(base)[2]; + return (i==0) ? get_pointee_or_identity(base)[0] : + (i==1) ? get_pointee_or_identity(base)[1] : + get_pointee_or_identity(base)[2]; } const Point_2 & diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h index 219f33b20a0..3f5e7f7835c 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Triangle_3.h @@ -95,9 +95,9 @@ TriangleC3::vertex(int i) const { if (i<0) i=(i%3)+3; else if (i>2) i=i%3; - return (i==0) ? get(base)[0] : - (i==1) ? get(base)[1] : - get(base)[2]; + return (i==0) ? get_pointee_or_identity(base)[0] : + (i==1) ? get_pointee_or_identity(base)[1] : + get_pointee_or_identity(base)[2]; } template < class R > diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h index 4c9f7ddd4c0..cbaae743668 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h @@ -65,12 +65,12 @@ public: const FT & x() const { - return CGAL::get(base)[0]; + return CGAL::get_pointee_or_identity(base)[0]; } const FT & y() const { - return CGAL::get(base)[1]; + return CGAL::get_pointee_or_identity(base)[1]; } const FT & hx() const @@ -90,12 +90,12 @@ public: Cartesian_const_iterator cartesian_begin() const { - return CGAL::get(base).begin(); + return CGAL::get_pointee_or_identity(base).begin(); } Cartesian_const_iterator cartesian_end() const { - return CGAL::get(base).end(); + return CGAL::get_pointee_or_identity(base).end(); } }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index 14ce5e6c8b7..8257a3b2d0b 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -80,15 +80,15 @@ public: const FT_ & x() const { - return get(base)[0]; + return get_pointee_or_identity(base)[0]; } const FT_ & y() const { - return get(base)[1]; + return get_pointee_or_identity(base)[1]; } const FT_ & z() const { - return get(base)[2]; + return get_pointee_or_identity(base)[2]; } const FT_ & hx() const @@ -110,12 +110,12 @@ public: Cartesian_const_iterator cartesian_begin() const { - return get(base).begin(); + return get_pointee_or_identity(base).begin(); } Cartesian_const_iterator cartesian_end() const { - return get(base).end(); + return get_pointee_or_identity(base).end(); } const FT_ & cartesian(int i) const; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h index d9bc72f3436..0b534be69ba 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h @@ -57,7 +57,7 @@ namespace CGAL { public: const Sphere_3& reference_sphere(){ - return get_ref_sphere(get(base).template get<0>()); + return get_ref_sphere(get_pointee_or_identity(base).template get<0>()); }; @@ -228,17 +228,17 @@ namespace CGAL { const Circle_3& supporting_circle() const { - return get(base).template get<0>(); + return get_pointee_or_identity(base).template get<0>(); } const Circular_arc_point_3& source() const { - return get(base).template get<1>(); + return get_pointee_or_identity(base).template get<1>(); } const Circular_arc_point_3& target() const { - return get(base).template get<2>(); + return get_pointee_or_identity(base).template get<2>(); } Plane_3 supporting_plane() const { diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h index b970139a000..8cea92f66d1 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h @@ -207,14 +207,14 @@ public: } } - const Root_of_2 & x() const { return get(base).x(); } - const Root_of_2 & y() const { return get(base).y(); } - const Root_of_2 & z() const { return get(base).z(); } + const Root_of_2 & x() const { return get_pointee_or_identity(base).x(); } + const Root_of_2 & y() const { return get_pointee_or_identity(base).y(); } + const Root_of_2 & z() const { return get_pointee_or_identity(base).z(); } - const Root_for_spheres_2_3 & coordinates() const { return get(base); } + const Root_for_spheres_2_3 & coordinates() const { return get_pointee_or_identity(base); } const CGAL::Bbox_3 bbox() const { - return get(base).bbox(); + return get_pointee_or_identity(base).bbox(); } bool operator==(const Circular_arc_point_3 &) const; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h index cc0e73b1918..1ee15c1e3c3 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h @@ -150,17 +150,17 @@ namespace CGAL { const Line_3& supporting_line() const { - return get(base).template get<0>(); + return get_pointee_or_identity(base).template get<0>(); } const Circular_arc_point_3& source() const { - return get(base).template get<1>(); + return get_pointee_or_identity(base).template get<1>(); } const Circular_arc_point_3& target() const { - return get(base).template get<2>(); + return get_pointee_or_identity(base).template get<2>(); } const Circular_arc_point_3& lower_xyz_extremity() const diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h index c5ce9c1c776..a8e41dfb2f4 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/CircleH2.h @@ -115,13 +115,13 @@ template inline const typename CircleH2::Point_2 & CircleH2::center() const -{ return get(base).template get<0>(); } +{ return get_pointee_or_identity(base).template get<0>(); } template inline const typename CircleH2::FT & CircleH2::squared_radius() const -{ return get(base).template get<1>(); } +{ return get_pointee_or_identity(base).template get<1>(); } template CGAL_KERNEL_INLINE @@ -137,7 +137,7 @@ template inline Orientation CircleH2::orientation() const -{ return get(base).template get<2>(); } +{ return get_pointee_or_identity(base).template get<2>(); } template CGAL_KERNEL_INLINE diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h index 4ccd961a280..b39c3cb67fa 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h @@ -78,12 +78,12 @@ public: Vector_2 to_vector() const; - const RT & x() const { return CGAL::get(base)[0]; } - const RT & y() const { return CGAL::get(base)[1]; } + const RT & x() const { return CGAL::get_pointee_or_identity(base)[0]; } + const RT & y() const { return CGAL::get_pointee_or_identity(base)[1]; } const RT & delta(int i) const; - const RT & dx() const { return CGAL::get(base)[0]; } - const RT & dy() const { return CGAL::get(base)[1]; } + const RT & dx() const { return CGAL::get_pointee_or_identity(base)[0]; } + const RT & dy() const { return CGAL::get_pointee_or_identity(base)[1]; } }; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h index 142449ee4f4..594c9abd491 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h @@ -82,15 +82,15 @@ public: Vector_3 to_vector() const; Vector_3 vector() const { return to_vector(); } - const RT & dx() const { return get(base)[0]; } - const RT & dy() const { return get(base)[1]; } - const RT & dz() const { return get(base)[2]; } - const RT & x() const { return get(base)[0]; } - const RT & y() const { return get(base)[1]; } - const RT & z() const { return get(base)[2]; } - const RT & hx() const { return get(base)[0]; } - const RT & hy() const { return get(base)[1]; } - const RT & hz() const { return get(base)[2]; } + const RT & dx() const { return get_pointee_or_identity(base)[0]; } + const RT & dy() const { return get_pointee_or_identity(base)[1]; } + const RT & dz() const { return get_pointee_or_identity(base)[2]; } + const RT & x() const { return get_pointee_or_identity(base)[0]; } + const RT & y() const { return get_pointee_or_identity(base)[1]; } + const RT & z() const { return get_pointee_or_identity(base)[2]; } + const RT & hx() const { return get_pointee_or_identity(base)[0]; } + const RT & hy() const { return get_pointee_or_identity(base)[1]; } + const RT & hz() const { return get_pointee_or_identity(base)[2]; } }; template diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h index bec9cb1897a..788f862a7c2 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h @@ -213,13 +213,13 @@ template < class R > inline const typename Iso_cuboidH3::Point_3 & Iso_cuboidH3::min BOOST_PREVENT_MACRO_SUBSTITUTION () const -{ return get(base)[0]; } +{ return get_pointee_or_identity(base)[0]; } template < class R > inline const typename Iso_cuboidH3::Point_3 & Iso_cuboidH3::max BOOST_PREVENT_MACRO_SUBSTITUTION () const -{ return get(base)[1]; } +{ return get_pointee_or_identity(base)[1]; } template < class R > inline diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h index 5ca7ce7ab9c..0d19aa890c0 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_rectangleH2.h @@ -69,13 +69,13 @@ template < class R > inline const typename Iso_rectangleH2::Point_2 & Iso_rectangleH2::min BOOST_PREVENT_MACRO_SUBSTITUTION () const -{ return get(base)[0]; } +{ return get_pointee_or_identity(base)[0]; } template < class R > inline const typename Iso_rectangleH2::Point_2 & Iso_rectangleH2::max BOOST_PREVENT_MACRO_SUBSTITUTION () const -{ return get(base)[1]; } +{ return get_pointee_or_identity(base)[1]; } template < class R > CGAL_KERNEL_INLINE diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h index 90536b43a4d..5f7f7962093 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h @@ -58,9 +58,9 @@ public: bool operator==(const LineH2& l) const; bool operator!=(const LineH2& l) const; - const RT & a() const { return get(base)[0]; } - const RT & b() const { return get(base)[1]; } - const RT & c() const { return get(base)[2]; } + const RT & a() const { return get_pointee_or_identity(base)[0]; } + const RT & b() const { return get_pointee_or_identity(base)[1]; } + const RT & c() const { return get_pointee_or_identity(base)[2]; } }; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h index c768e5e8e48..8bc53ae8230 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h @@ -258,25 +258,25 @@ template < class R > inline const typename PlaneH3::RT & PlaneH3::a() const -{ return get(base)[0]; } +{ return get_pointee_or_identity(base)[0]; } template < class R > inline const typename PlaneH3::RT & PlaneH3::b() const -{ return get(base)[1]; } +{ return get_pointee_or_identity(base)[1]; } template < class R > inline const typename PlaneH3::RT & PlaneH3::c() const -{ return get(base)[2]; } +{ return get_pointee_or_identity(base)[2]; } template < class R > inline const typename PlaneH3::RT & PlaneH3::d() const -{ return get(base)[3]; } +{ return get_pointee_or_identity(base)[3]; } template < class R > CGAL_KERNEL_INLINE diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h index 44b191a06f0..bb743a5834c 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h @@ -84,20 +84,20 @@ template < class R > inline const typename RayH3::Point_3 & RayH3::source() const -{ return get(base).first; } +{ return get_pointee_or_identity(base).first; } template < class R > inline const typename RayH3::Point_3 & RayH3::start() const -{ return get(base).first; } +{ return get_pointee_or_identity(base).first; } template < class R > inline const typename RayH3::Vector_3 & RayH3::to_vector() const { - return get(base).second; + return get_pointee_or_identity(base).second; } template < class R > diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h index 57f3424e003..bb79b5f3a57 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h @@ -182,19 +182,19 @@ template inline const typename SphereH3::Point_3 & SphereH3::center() const -{ return get(base).template get<0>(); } +{ return get_pointee_or_identity(base).template get<0>(); } template inline const typename SphereH3::FT & SphereH3::squared_radius() const -{ return get(base).template get<1>(); } +{ return get_pointee_or_identity(base).template get<1>(); } template inline Orientation SphereH3::orientation() const -{ return get(base).template get<2>(); } +{ return get_pointee_or_identity(base).template get<2>(); } template inline diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h index 28ccb8d7eab..cc87d3053a3 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h @@ -95,9 +95,9 @@ public: bool operator==( const Null_vector&) const; bool operator!=( const Null_vector& v) const; - const RT & hx() const { return CGAL::get(base)[0]; }; - const RT & hy() const { return CGAL::get(base)[1]; }; - const RT & hw() const { return CGAL::get(base)[2]; }; + const RT & hx() const { return CGAL::get_pointee_or_identity(base)[0]; }; + const RT & hy() const { return CGAL::get_pointee_or_identity(base)[1]; }; + const RT & hw() const { return CGAL::get_pointee_or_identity(base)[2]; }; FT x() const { return FT(hx()) / FT(hw()); }; FT y() const { return FT(hy()) / FT(hw()); }; @@ -108,13 +108,13 @@ public: Cartesian_const_iterator cartesian_begin() const { - return make_cartesian_const_iterator_begin(CGAL::get(base).begin(), - boost::prior(CGAL::get(base).end())); + return make_cartesian_const_iterator_begin(CGAL::get_pointee_or_identity(base).begin(), + boost::prior(CGAL::get_pointee_or_identity(base).end())); } Cartesian_const_iterator cartesian_end() const { - return make_cartesian_const_iterator_end(boost::prior(CGAL::get(base).end())); + return make_cartesian_const_iterator_end(boost::prior(CGAL::get_pointee_or_identity(base).end())); } int dimension() const; @@ -181,7 +181,7 @@ const typename VectorH2::RT & VectorH2::homogeneous(int i) const { CGAL_kernel_precondition( (i>=0) && (i<=2) ); - return CGAL::get(base)[i]; + return CGAL::get_pointee_or_identity(base)[i]; } template < class R > diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h index d50408762ac..6c50ebc5184 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h @@ -100,10 +100,10 @@ public: : base( w >= RT(0) ? CGAL::make_array(x, y, z, w) : CGAL::make_array(-x, -y, -z, -w) ) {} - const RT & hx() const { return get(base)[0]; } - const RT & hy() const { return get(base)[1]; } - const RT & hz() const { return get(base)[2]; } - const RT & hw() const { return get(base)[3]; } + const RT & hx() const { return get_pointee_or_identity(base)[0]; } + const RT & hy() const { return get_pointee_or_identity(base)[1]; } + const RT & hz() const { return get_pointee_or_identity(base)[2]; } + const RT & hw() const { return get_pointee_or_identity(base)[3]; } FT x() const { return FT(hx())/FT(hw()); } FT y() const { return FT(hy())/FT(hw()); } FT z() const { return FT(hz())/FT(hw()); } @@ -113,13 +113,13 @@ public: Cartesian_const_iterator cartesian_begin() const { - return make_cartesian_const_iterator_begin(get(base).begin(), - boost::prior(get(base).end())); + return make_cartesian_const_iterator_begin(get_pointee_or_identity(base).begin(), + boost::prior(get_pointee_or_identity(base).end())); } Cartesian_const_iterator cartesian_end() const { - return make_cartesian_const_iterator_end(boost::prior(get(base).end())); + return make_cartesian_const_iterator_end(boost::prior(get_pointee_or_identity(base).end())); } int dimension() const { return 3; }; @@ -159,7 +159,7 @@ const typename VectorH3::RT & VectorH3::homogeneous(int i) const { CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3); - return get(base)[i]; + return get_pointee_or_identity(base)[i]; } template < class R > diff --git a/Kernel_23/include/CGAL/Ray_3.h b/Kernel_23/include/CGAL/Ray_3.h index 1d004ec2063..0be3ade7977 100644 --- a/Kernel_23/include/CGAL/Ray_3.h +++ b/Kernel_23/include/CGAL/Ray_3.h @@ -93,7 +93,7 @@ public: const Point_3 & start() const; const Point_3 & source() const { - return get(base).e0; + return get_pointee_or_identity(base).e0; } Direction_3 direction() const; diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h index 4c60713ab46..9f3896851bb 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h @@ -63,7 +63,7 @@ public: const Rep& rep() const { - return CGAL::get(data); + return CGAL::get_pointee_or_identity(data); } #ifdef CGAL_CXX11 diff --git a/Point_set_processing_3/include/CGAL/property_map.h b/Point_set_processing_3/include/CGAL/property_map.h index 6f3c7ff300f..aa22803bf2a 100644 --- a/Point_set_processing_3/include/CGAL/property_map.h +++ b/Point_set_processing_3/include/CGAL/property_map.h @@ -36,7 +36,6 @@ namespace CGAL { - using ::get; /// \cond SKIP_DOXYGEN /// Property map that accesses a value from an iterator diff --git a/STL_Extension/include/CGAL/Handle_for.h b/STL_Extension/include/CGAL/Handle_for.h index 202bde3fe9e..dbdd92c33a1 100644 --- a/STL_Extension/include/CGAL/Handle_for.h +++ b/STL_Extension/include/CGAL/Handle_for.h @@ -292,7 +292,7 @@ template inline bool identical(const T &t1, const T &t2) { return &t1 template inline const T& -get(const Handle_for &h) +get_pointee_or_identity(const Handle_for &h) { return *(h.Ptr()); } @@ -300,7 +300,7 @@ get(const Handle_for &h) template inline const T& -get(const T &t) +get_pointee_or_identity(const T &t) { return t; }