From 2a1338ce2d7c813db6f650154e2e3b6fdde06ff5 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 21 Apr 2018 08:43:03 +1000 Subject: Backport: Tighten definition of regular expression iterators so they are noexcept and define all the standard member functions. This cascades to all methods called by the iterators, affecting Document, CellBuffer, Partitioning, SplitVector and UTF-8 and DBCS functions. Other trivial functions declared noexcept. Backport of changeset 6724:f2dfdc0dddd3. --- src/Partitioning.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Partitioning.h') diff --git a/src/Partitioning.h b/src/Partitioning.h index 3872879e7..89faf8b8e 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -102,7 +102,7 @@ public: ~Partitioning() { } - T Partitions() const { + T Partitions() const noexcept { return static_cast(body->Length())-1; } @@ -154,7 +154,7 @@ public: body->Delete(partition); } - T PositionFromPartition(T partition) const { + T PositionFromPartition(T partition) const noexcept { PLATFORM_ASSERT(partition >= 0); PLATFORM_ASSERT(partition < body->Length()); const ptrdiff_t lengthBody = body->Length(); @@ -168,7 +168,7 @@ public: } /// Return value in range [0 .. Partitions() - 1] even for arguments outside interval - T PartitionFromPosition(T pos) const { + T PartitionFromPosition(T pos) const noexcept { if (body->Length() <= 1) return 0; if (pos >= (PositionFromPartition(Partitions()))) -- cgit v1.2.3