From 72bf8cc76af06198234e3f4cc98e06fc55b99ce0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 15 Sep 2021 07:07:18 +0100 Subject: [PATCH] Fix Cone_spanners passing to std::array --- .../Cone_spanners_2/Plane_scan_tree_impl.h | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h index 411a671f843..b76b5a64208 100644 --- a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h +++ b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h @@ -20,7 +20,7 @@ #include - +#include #include namespace CGAL { @@ -134,9 +134,8 @@ public: _Leaf (const key_compare& less, const value_compare& vless, tree_type *const t, _leaf_type *const prev = nullptr, _leaf_type *const next = nullptr) - : _node_type (less, vless, t), prev (prev), next (next) { - std::memset (values, 0, 2*sizeof(value_type*)); - } + : _node_type (less, vless, t), values({nullptr,nullptr}), prev (prev), next (next) + {} /* Destructor. * Frees memory used for storing key-value pair, thus invalidating any @@ -242,7 +241,7 @@ protected: private: /* Key-value pairs */ - value_type* values[2]; + std::array values; /* Linked list structure of the B+ tree */ _leaf_type* prev; @@ -268,11 +267,8 @@ public: typedef typename _node_type::tree_type tree_type; _Internal (const Comp& less, const VComp& vless, tree_type *const t) - : _node_type(less, vless, t) { - std::memset (keys, 0, 2*sizeof(key_type*)); - std::memset (children, 0, 3*sizeof(_node_type*)); - std::memset (vMin, 0, 3*sizeof(mapped_type*)); - } + : _node_type(less, vless, t), keys({nullptr, nullptr}), children({nullptr, nullptr, nullptr}), vMin({nullptr, nullptr, nullptr}) + {} virtual ~_Internal() { keys[0] = nullptr; @@ -492,9 +488,9 @@ protected: } private: - const key_type* keys[2]; - _node_type* children[3]; - const mapped_type* vMin[3]; + std::array keys; + std::array< _node_type*, 3> children; + std::array vMin; }; template