diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-25 10:28:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 10:28:49 +0200 |
commit | fd5ce27b54f776760d7718e0782273c889d62b8a (patch) | |
tree | ffb92a1ee11749d7aee0fca6ba7a58bdd0c38492 /vespalib | |
parent | 556eaec4921547aa6699fa96c719eaad9e870a70 (diff) | |
parent | 9e9d7df3c1202e81c94cdbddade250bc1affae79 (diff) |
Merge pull request #31041 from vespa-engine/balder/add-noexcept-2
Add noexcept
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/btree/btreenode.h | 114 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/btree/btreenode.hpp | 60 |
2 files changed, 84 insertions, 90 deletions
diff --git a/vespalib/src/vespa/vespalib/btree/btreenode.h b/vespalib/src/vespa/vespalib/btree/btreenode.h index c4862a256c9..d7741393d0e 100644 --- a/vespalib/src/vespa/vespalib/btree/btreenode.h +++ b/vespalib/src/vespa/vespalib/btree/btreenode.h @@ -92,7 +92,7 @@ public: BTreeNodeDataWrap() noexcept : _data() {} ~BTreeNodeDataWrap() = default; - void copyData(const BTreeNodeDataWrap &rhs, uint32_t validSlots) { + void copyData(const BTreeNodeDataWrap &rhs, uint32_t validSlots) noexcept { const DataT *rdata = rhs._data; DataT *ldata = _data; DataT *ldatae = _data + validSlots; @@ -112,27 +112,27 @@ template <uint32_t NumSlots> class BTreeNodeDataWrap<BTreeNoLeafData, NumSlots> { public: - BTreeNodeDataWrap() noexcept {} + BTreeNodeDataWrap() noexcept = default; - void copyData(const BTreeNodeDataWrap &rhs, uint32_t validSlots) { + void copyData(const BTreeNodeDataWrap &rhs, uint32_t validSlots) noexcept { (void) rhs; (void) validSlots; } - const BTreeNoLeafData &getData(uint32_t idx) const { + const BTreeNoLeafData &getData(uint32_t idx) const noexcept { (void) idx; return BTreeNoLeafData::_instance; } // Only use during compaction when changing reference to moved value - BTreeNoLeafData &getWData(uint32_t) const { return BTreeNoLeafData::_instance; } + BTreeNoLeafData &getWData(uint32_t) const noexcept { return BTreeNoLeafData::_instance; } - void setData(uint32_t idx, const BTreeNoLeafData &data) { + void setData(uint32_t idx, const BTreeNoLeafData &data) noexcept { (void) idx; (void) data; } - static bool hasData() { return false; } + static constexpr bool hasData() noexcept { return false; } }; @@ -148,9 +148,9 @@ public: BTreeNodeAggregatedWrap() noexcept : _aggr() {} - AggrT &getAggregated() { return _aggr; } - const AggrT &getAggregated() const { return _aggr; } - static const AggrT &getEmptyAggregated() { return _instance; } + AggrT &getAggregated() noexcept { return _aggr; } + const AggrT &getAggregated() const noexcept { return _aggr; } + static const AggrT &getEmptyAggregated() noexcept { return _instance; } }; @@ -163,9 +163,9 @@ class BTreeNodeAggregatedWrap<NoAggregated> public: BTreeNodeAggregatedWrap() noexcept = default; - NoAggregated &getAggregated() { return _instance; } - const NoAggregated &getAggregated() const { return _instance; } - static const NoAggregated &getEmptyAggregated() { return _instance; } + NoAggregated &getAggregated() noexcept { return _instance; } + const NoAggregated &getAggregated() const noexcept { return _instance; } + static const NoAggregated &getEmptyAggregated() noexcept { return _instance; } }; template <> MinMaxAggregated BTreeNodeAggregatedWrap<MinMaxAggregated>::_instance; @@ -216,13 +216,13 @@ public: void write_key_relaxed(uint32_t idx, const KeyT & key) noexcept { _keys[idx] = key; } template <typename CompareT> - uint32_t lower_bound(uint32_t sidx, const KeyT & key, CompareT comp) const; + uint32_t lower_bound(uint32_t sidx, const KeyT & key, CompareT comp) const noexcept; template <typename CompareT> - uint32_t lower_bound(const KeyT & key, CompareT comp) const; + uint32_t lower_bound(const KeyT & key, CompareT comp) const noexcept; template <typename CompareT> - uint32_t upper_bound(uint32_t sidx, const KeyT & key, CompareT comp) const; + uint32_t upper_bound(uint32_t sidx, const KeyT & key, CompareT comp) const noexcept; bool isFull() const noexcept { return validSlots() == NumSlots; } bool isAtLeastHalfFull() const noexcept { return validSlots() >= minSlots(); } @@ -271,22 +271,22 @@ protected: public: using NodeType = BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>; - void insert(uint32_t idx, const KeyT & key, const DataT & data); - void update(uint32_t idx, const KeyT & key, const DataT & data) { + void insert(uint32_t idx, const KeyT & key, const DataT & data) noexcept; + void update(uint32_t idx, const KeyT & key, const DataT & data) noexcept { // assert(idx < NodeType::maxSlots()); // assert(!getFrozen()); _keys[idx] = key; setData(idx, data); } - void splitInsert(NodeType * splitNode, uint32_t idx, const KeyT & key, const DataT & data); - void remove(uint32_t idx); - void stealAllFromLeftNode(const NodeType * victim); - void stealAllFromRightNode(const NodeType * victim); - void stealSomeFromLeftNode(NodeType * victim); - void stealSomeFromRightNode(NodeType * victim); - void cleanRange(uint32_t from, uint32_t to); - void clean(); - void cleanFrozen(); + void splitInsert(NodeType * splitNode, uint32_t idx, const KeyT & key, const DataT & data) noexcept; + void remove(uint32_t idx) noexcept; + void stealAllFromLeftNode(const NodeType * victim) noexcept; + void stealAllFromRightNode(const NodeType * victim) noexcept; + void stealSomeFromLeftNode(NodeType * victim) noexcept; + void stealSomeFromRightNode(NodeType * victim) noexcept; + void cleanRange(uint32_t from, uint32_t to) noexcept; + void clean() noexcept; + void cleanFrozen() noexcept; }; template <typename KeyT, typename AggrT, uint32_t NumSlots = 16> @@ -344,53 +344,53 @@ protected: } private: template <typename NodeAllocatorType> - uint32_t countValidLeaves(uint32_t start, uint32_t end, NodeAllocatorType &allocator); + uint32_t countValidLeaves(uint32_t start, uint32_t end, NodeAllocatorType &allocator) noexcept; public: - BTreeNode::Ref getChild(uint32_t idx) const { return _data[idx].load_acquire(); } - BTreeNode::Ref get_child_relaxed(uint32_t idx) const { return _data[idx].load_relaxed(); } - void setChild(uint32_t idx, BTreeNode::Ref child) { _data[idx].store_release(child); } - void set_child_relaxed(uint32_t idx, BTreeNode::Ref child) { _data[idx].store_relaxed(child); } - BTreeNode::Ref get_last_child_relaxed() const { return get_child_relaxed(validSlots() - 1); } - void update(uint32_t idx, const KeyT & key, BTreeNode::Ref child) { + BTreeNode::Ref getChild(uint32_t idx) const noexcept { return _data[idx].load_acquire(); } + BTreeNode::Ref get_child_relaxed(uint32_t idx) const noexcept { return _data[idx].load_relaxed(); } + void setChild(uint32_t idx, BTreeNode::Ref child) noexcept { _data[idx].store_release(child); } + void set_child_relaxed(uint32_t idx, BTreeNode::Ref child) noexcept { _data[idx].store_relaxed(child); } + BTreeNode::Ref get_last_child_relaxed() const noexcept { return get_child_relaxed(validSlots() - 1); } + void update(uint32_t idx, const KeyT & key, BTreeNode::Ref child) noexcept { update(idx, key, BTreeNode::ChildRef(child)); } - void insert(uint32_t idx, const KeyT & key, BTreeNode::Ref child) { + void insert(uint32_t idx, const KeyT & key, BTreeNode::Ref child) noexcept { insert(idx, key, BTreeNode::ChildRef(child)); } uint32_t validLeaves() const noexcept { return _validLeaves; } - void setValidLeaves(uint32_t newValidLeaves) { _validLeaves = newValidLeaves; } - void incValidLeaves(uint32_t delta) { _validLeaves += delta; } - void decValidLeaves(uint32_t delta) { _validLeaves -= delta; } + void setValidLeaves(uint32_t newValidLeaves) noexcept { _validLeaves = newValidLeaves; } + void incValidLeaves(uint32_t delta) noexcept { _validLeaves += delta; } + void decValidLeaves(uint32_t delta) noexcept { _validLeaves -= delta; } template <typename NodeAllocatorType> void splitInsert(BTreeInternalNode *splitNode, uint32_t idx, const KeyT &key, - const BTreeNode::Ref &data, NodeAllocatorType &allocator); + const BTreeNode::Ref &data, NodeAllocatorType &allocator) noexcept; - void stealAllFromLeftNode(const BTreeInternalNode *victim); - void stealAllFromRightNode(const BTreeInternalNode *victim); + void stealAllFromLeftNode(const BTreeInternalNode *victim) noexcept; + void stealAllFromRightNode(const BTreeInternalNode *victim) noexcept; template <typename NodeAllocatorType> - void stealSomeFromLeftNode(BTreeInternalNode *victim, NodeAllocatorType &allocator); + void stealSomeFromLeftNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) noexcept; template <typename NodeAllocatorType> - void stealSomeFromRightNode(BTreeInternalNode *victim, NodeAllocatorType &allocator); + void stealSomeFromRightNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) noexcept; - void clean(); - void cleanFrozen(); + void clean() noexcept; + void cleanFrozen() noexcept; template <typename NodeStoreType, typename FunctionType> - void foreach_key(NodeStoreType &store, FunctionType func) const; + void foreach_key(NodeStoreType &store, FunctionType func) const noexcept; /** * Call func with leaf entry key value as argument for all leaf entries in subtrees * for children [start_idx, end_idx). */ template <typename NodeStoreType, typename FunctionType> - void foreach_key_range(NodeStoreType &store, uint32_t start_idx, uint32_t end_idx, FunctionType func) const; + void foreach_key_range(NodeStoreType &store, uint32_t start_idx, uint32_t end_idx, FunctionType func) const noexcept; template <typename NodeStoreType, typename FunctionType> - void foreach(NodeStoreType &store, FunctionType func) const; + void foreach(NodeStoreType &store, FunctionType func) const noexcept; }; template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots = 16> @@ -439,33 +439,31 @@ protected: public: template <typename NodeAllocatorType> - void stealSomeFromLeftNode(BTreeLeafNode *victim, NodeAllocatorType &allocator) + void stealSomeFromLeftNode(BTreeLeafNode *victim, NodeAllocatorType &) noexcept { - (void) allocator; stealSomeFromLeftNode(victim); } template <typename NodeAllocatorType> - void stealSomeFromRightNode(BTreeLeafNode *victim, NodeAllocatorType &allocator) { - (void) allocator; + void stealSomeFromRightNode(BTreeLeafNode *victim, NodeAllocatorType &) noexcept { stealSomeFromRightNode(victim); } - const DataT &getLastData() const { return this->getData(validSlots() - 1); } - void writeData(uint32_t idx, const DataT &data) { this->setData(idx, data); } + const DataT &getLastData() const noexcept { return this->getData(validSlots() - 1); } + void writeData(uint32_t idx, const DataT &data) noexcept { this->setData(idx, data); } uint32_t validLeaves() const noexcept { return validSlots(); } template <typename FunctionType> - void foreach_key(FunctionType func) const; + void foreach_key(FunctionType func) const noexcept; /** * Call func with leaf entry key value as argument for leaf entries [start_idx, end_idx). */ template <typename FunctionType> - void foreach_key_range(uint32_t start_idx, uint32_t end_idx, FunctionType func) const; + void foreach_key_range(uint32_t start_idx, uint32_t end_idx, FunctionType func) const noexcept; template <typename FunctionType> - void foreach(FunctionType func) const; + void foreach(FunctionType func) const noexcept; }; @@ -480,7 +478,7 @@ public: : ParentType(smallArray, arraySize) {} - ~BTreeLeafNodeTemp() {} + ~BTreeLeafNodeTemp() = default; }; extern template class BTreeNodeDataWrap<uint32_t, 16>; diff --git a/vespalib/src/vespa/vespalib/btree/btreenode.hpp b/vespalib/src/vespa/vespalib/btree/btreenode.hpp index 12b5c985ca6..c636851b4b2 100644 --- a/vespalib/src/vespa/vespalib/btree/btreenode.hpp +++ b/vespalib/src/vespa/vespalib/btree/btreenode.hpp @@ -42,7 +42,7 @@ template <typename KeyT, uint32_t NumSlots> template <typename CompareT> uint32_t BTreeNodeT<KeyT, NumSlots>:: -lower_bound(uint32_t sidx, const KeyT & key, CompareT comp) const +lower_bound(uint32_t sidx, const KeyT & key, CompareT comp) const noexcept { const KeyT * itr = std::lower_bound<const KeyT *, KeyT, CompareT> (_keys + sidx, _keys + validSlots(), key, comp); @@ -52,9 +52,8 @@ lower_bound(uint32_t sidx, const KeyT & key, CompareT comp) const template <typename KeyT, uint32_t NumSlots> template <typename CompareT> uint32_t -BTreeNodeT<KeyT, NumSlots>::lower_bound(const KeyT & key, CompareT comp) const +BTreeNodeT<KeyT, NumSlots>::lower_bound(const KeyT & key, CompareT comp) const noexcept { - const KeyT * itr = std::lower_bound<const KeyT *, KeyT, CompareT> (_keys, _keys + validSlots(), key, comp); return itr - _keys; @@ -65,7 +64,7 @@ template <typename KeyT, uint32_t NumSlots> template <typename CompareT> uint32_t BTreeNodeT<KeyT, NumSlots>:: -upper_bound(uint32_t sidx, const KeyT & key, CompareT comp) const +upper_bound(uint32_t sidx, const KeyT & key, CompareT comp) const noexcept { const KeyT * itr = std::upper_bound<const KeyT *, KeyT, CompareT> (_keys + sidx, _keys + validSlots(), key, comp); @@ -75,7 +74,7 @@ upper_bound(uint32_t sidx, const KeyT & key, CompareT comp) const template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void -BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::insert(uint32_t idx, const KeyT &key, const DataT &data) +BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::insert(uint32_t idx, const KeyT &key, const DataT &data) noexcept { assert(validSlots() < NodeType::maxSlots()); assert(!getFrozen()); @@ -90,10 +89,8 @@ BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::insert(uint32_t idx, const KeyT &key, template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void -BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::splitInsert(NodeType *splitNode, - uint32_t idx, - const KeyT &key, - const DataT &data) +BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>:: +splitInsert(NodeType *splitNode, uint32_t idx, const KeyT &key, const DataT &data) noexcept { assert(!getFrozen()); assert(!splitNode->getFrozen()); @@ -114,7 +111,7 @@ BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::splitInsert(NodeType *splitNode, template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void -BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::remove(uint32_t idx) +BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::remove(uint32_t idx) noexcept { assert(!getFrozen()); for (uint32_t i = idx + 1; i < validSlots(); ++i) { @@ -129,7 +126,7 @@ BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::remove(uint32_t idx) template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>:: -stealAllFromLeftNode(const NodeType *victim) +stealAllFromLeftNode(const NodeType *victim) noexcept { assert(validSlots() + victim->validSlots() <= NodeType::maxSlots()); assert(!getFrozen()); @@ -147,7 +144,7 @@ stealAllFromLeftNode(const NodeType *victim) template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>:: -stealAllFromRightNode(const NodeType *victim) +stealAllFromRightNode(const NodeType *victim) noexcept { assert(validSlots() + victim->validSlots() <= NodeType::maxSlots()); assert(!getFrozen()); @@ -161,7 +158,7 @@ stealAllFromRightNode(const NodeType *victim) template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>:: -stealSomeFromLeftNode(NodeType *victim) +stealSomeFromLeftNode(NodeType *victim) noexcept { assert(validSlots() + victim->validSlots() >= NodeType::minSlots()); assert(!getFrozen()); @@ -184,7 +181,7 @@ stealSomeFromLeftNode(NodeType *victim) template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>:: -stealSomeFromRightNode(NodeType *victim) +stealSomeFromRightNode(NodeType *victim) noexcept { assert(validSlots() + victim->validSlots() >= NodeType::minSlots()); assert(!getFrozen()); @@ -207,7 +204,7 @@ stealSomeFromRightNode(NodeType *victim) template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void -BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::cleanRange(uint32_t from, uint32_t to) +BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::cleanRange(uint32_t from, uint32_t to) noexcept { assert(from < to); assert(to <= validSlots()); @@ -224,7 +221,7 @@ BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::cleanRange(uint32_t from, uint32_t to template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void -BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::clean() +BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::clean() noexcept { if (validSlots() == 0) return; @@ -235,7 +232,7 @@ BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::clean() template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> void -BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::cleanFrozen() +BTreeNodeTT<KeyT, DataT, AggrT, NumSlots>::cleanFrozen() noexcept { assert(validSlots() <= NodeType::maxSlots()); assert(getFrozen()); @@ -256,8 +253,7 @@ template <typename NodeAllocatorType> void BTreeInternalNode<KeyT, AggrT, NumSlots>:: splitInsert(BTreeInternalNode *splitNode, uint32_t idx, const KeyT &key, - const BTreeNode::Ref &data, - NodeAllocatorType &allocator) + const BTreeNode::Ref &data, NodeAllocatorType &allocator) noexcept { assert(!getFrozen()); assert(!splitNode->getFrozen()); @@ -287,7 +283,7 @@ splitInsert(BTreeInternalNode *splitNode, uint32_t idx, const KeyT &key, template <typename KeyT, typename AggrT, uint32_t NumSlots> void BTreeInternalNode<KeyT, AggrT, NumSlots>:: -stealAllFromLeftNode(const BTreeInternalNode *victim) +stealAllFromLeftNode(const BTreeInternalNode *victim) noexcept { ParentType::stealAllFromLeftNode(victim); _validLeaves += victim->_validLeaves; @@ -296,7 +292,7 @@ stealAllFromLeftNode(const BTreeInternalNode *victim) template <typename KeyT, typename AggrT, uint32_t NumSlots> void BTreeInternalNode<KeyT, AggrT, NumSlots>:: -stealAllFromRightNode(const BTreeInternalNode *victim) +stealAllFromRightNode(const BTreeInternalNode *victim) noexcept { ParentType::stealAllFromRightNode(victim); _validLeaves += victim->_validLeaves; @@ -305,7 +301,7 @@ stealAllFromRightNode(const BTreeInternalNode *victim) template <typename KeyT, typename AggrT, uint32_t NumSlots> template <typename NodeAllocatorType> uint32_t -BTreeInternalNode<KeyT, AggrT, NumSlots>::countValidLeaves(uint32_t start, uint32_t end, NodeAllocatorType &allocator) +BTreeInternalNode<KeyT, AggrT, NumSlots>::countValidLeaves(uint32_t start, uint32_t end, NodeAllocatorType &allocator) noexcept { assert(start <= end); assert(end <= validSlots()); @@ -320,7 +316,7 @@ template <typename KeyT, typename AggrT, uint32_t NumSlots> template <typename NodeAllocatorType> void BTreeInternalNode<KeyT, AggrT, NumSlots>:: -stealSomeFromLeftNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) +stealSomeFromLeftNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) noexcept { uint16_t oldValidSlots = validSlots(); ParentType::stealSomeFromLeftNode(victim); @@ -334,7 +330,7 @@ template <typename KeyT, typename AggrT, uint32_t NumSlots> template <typename NodeAllocatorType> void BTreeInternalNode<KeyT, AggrT, NumSlots>:: -stealSomeFromRightNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) +stealSomeFromRightNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) noexcept { uint16_t oldValidSlots = validSlots(); ParentType::stealSomeFromRightNode(victim); @@ -346,7 +342,7 @@ stealSomeFromRightNode(BTreeInternalNode *victim, NodeAllocatorType &allocator) template <typename KeyT, typename AggrT, uint32_t NumSlots> void -BTreeInternalNode<KeyT, AggrT, NumSlots>::clean() +BTreeInternalNode<KeyT, AggrT, NumSlots>::clean() noexcept { ParentType::clean(); _validLeaves = 0; @@ -355,7 +351,7 @@ BTreeInternalNode<KeyT, AggrT, NumSlots>::clean() template <typename KeyT, typename AggrT, uint32_t NumSlots> void -BTreeInternalNode<KeyT, AggrT, NumSlots>::cleanFrozen() +BTreeInternalNode<KeyT, AggrT, NumSlots>::cleanFrozen() noexcept { ParentType::cleanFrozen(); _validLeaves = 0; @@ -364,7 +360,7 @@ BTreeInternalNode<KeyT, AggrT, NumSlots>::cleanFrozen() template <typename KeyT, typename AggrT, uint32_t NumSlots> template <typename NodeStoreType, typename FunctionType> void -BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach_key(NodeStoreType &store, FunctionType func) const { +BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach_key(NodeStoreType &store, FunctionType func) const noexcept { const BTreeNode::ChildRef *it = this->_data; const BTreeNode::ChildRef *ite = it + _validSlots; if (this->getLevel() > 1u) { @@ -385,7 +381,7 @@ BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach_key(NodeStoreType &store, Func template <typename KeyT, typename AggrT, uint32_t NumSlots> template <typename NodeStoreType, typename FunctionType> void -BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach_key_range(NodeStoreType &store, uint32_t start_idx, uint32_t end_idx, FunctionType func) const { +BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach_key_range(NodeStoreType &store, uint32_t start_idx, uint32_t end_idx, FunctionType func) const noexcept { const BTreeNode::ChildRef *it = this->_data; const BTreeNode::ChildRef *ite = it + end_idx; it += start_idx; @@ -403,7 +399,7 @@ BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach_key_range(NodeStoreType &store template <typename KeyT, typename AggrT, uint32_t NumSlots> template <typename NodeStoreType, typename FunctionType> void -BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach(NodeStoreType &store, FunctionType func) const { +BTreeInternalNode<KeyT, AggrT, NumSlots>::foreach(NodeStoreType &store, FunctionType func) const noexcept { const BTreeNode::ChildRef *it = this->_data; const BTreeNode::ChildRef *ite = it + _validSlots; if (this->getLevel() > 1u) { @@ -436,7 +432,7 @@ BTreeLeafNode(const KeyDataType *smallArray, uint32_t arraySize) noexcept template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> template <typename FunctionType> void -BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach_key(FunctionType func) const { +BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach_key(FunctionType func) const noexcept { const KeyT *it = _keys; const KeyT *ite = it + _validSlots; for (; it != ite; ++it) { @@ -450,7 +446,7 @@ BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach_key(FunctionType func) cons template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> template <typename FunctionType> void -BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach_key_range(uint32_t start_idx, uint32_t end_idx, FunctionType func) const { +BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach_key_range(uint32_t start_idx, uint32_t end_idx, FunctionType func) const noexcept { const KeyT *it = _keys; const KeyT *ite = it + end_idx; it += start_idx; @@ -462,7 +458,7 @@ BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach_key_range(uint32_t start_id template <typename KeyT, typename DataT, typename AggrT, uint32_t NumSlots> template <typename FunctionType> void -BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach(FunctionType func) const { +BTreeLeafNode<KeyT, DataT, AggrT, NumSlots>::foreach(FunctionType func) const noexcept { const KeyT *it = _keys; const KeyT *ite = it + _validSlots; uint32_t idx = 0; |