summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-08-12 15:14:26 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-08-12 15:14:26 +0100
commit2d5894b9c5cf442528d52ad1845752731ff276f8 (patch)
tree0b5936fa1a98b25796c7dc801768bfc1c5cacd54
parentPass ModelPartParam by value, it's just a pointer (diff)
downloadslicer-2d5894b9c5cf442528d52ad1845752731ff276f8.tar.bz2
slicer-2d5894b9c5cf442528d52ad1845752731ff276f8.tar.xz
slicer-2d5894b9c5cf442528d52ad1845752731ff276f8.zip
Hook range iter constructor which doesn't call moveMatch for end
-rw-r--r--slicer/slicer/hookMap.h6
1 files 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 {};