Fix Cone_spanners passing to std::array

This commit is contained in:
Andreas Fabri 2021-09-15 07:07:18 +01:00 committed by Sébastien Loriot
parent 637d61c974
commit 72bf8cc76a
1 changed files with 9 additions and 13 deletions

View File

@ -20,7 +20,7 @@
#include <CGAL/license/Cone_spanners_2.h>
#include <array>
#include <stdexcept>
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<value_type*,2> 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<const key_type*, 2> keys;
std::array< _node_type*, 3> children;
std::array<const mapped_type*, 3> vMin;
};
template <typename Key, typename T, typename Comp, typename VComp >