diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h index c4f1504a73e..d47056d1e77 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h @@ -87,6 +87,8 @@ private: typedef AABB_node Node; typedef typename AABB_traits::Primitive Primitive; + +public: /// Helper functions const Node& left_child() const { return *static_cast(m_p_left_child); } @@ -97,8 +99,7 @@ private: const Primitive& right_data() const { return *static_cast(m_p_right_child); } -public: - +private: Node& left_child() { return *static_cast(m_p_left_child); } Node& right_child() { return *static_cast(m_p_right_child); } Primitive& left_data() { return *static_cast(m_p_left_child); } diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h index 99db0a88686..cc85b23ec89 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h @@ -142,8 +142,8 @@ private: struct Node_ptr_with_ft { Node_ptr_with_ft(const Node* node, const FT& value, size_type nb_primitives) - : node(const_cast(node)), value(value), nb_primitives(nb_primitives) {} - Node* node; + : node(node), value(value), nb_primitives(nb_primitives) {} + const Node* node; FT value; size_type nb_primitives; bool operator<(const Node_ptr_with_ft& other) const { return value < other.value; }