From 2d5894b9c5cf442528d52ad1845752731ff276f8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 12 Aug 2023 15:14:26 +0100 Subject: Hook range iter constructor which doesn't call moveMatch for end --- slicer/slicer/hookMap.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slicer/slicer/hookMap.h b/slicer/slicer/hookMap.h index fe8e646..daef5b0 100644 --- a/slicer/slicer/hookMap.h +++ b/slicer/slicer/hookMap.h @@ -28,6 +28,8 @@ namespace Slicer { using pointer = HookPtr *; using reference = HookPtr &; + [[nodiscard]] constexpr inline explicit iter(const eq * const r) : range(r), cur(r->e) { } + [[nodiscard]] constexpr inline iter(const eq * const r, const HookPtr * c) : range(r), cur(c) { moveMatch(); @@ -93,13 +95,13 @@ namespace Slicer { [[nodiscard]] constexpr inline iter begin() const { - return {this, b}; + return iter {this, b}; } [[nodiscard]] constexpr inline iter end() const { - return {this, e}; + return iter {this}; } std::string_view key {}; -- cgit v1.2.3