From 8634c0958c532e7d219e649353e1f1a74d52da1b Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 21 Apr 2018 08:43:03 +1000 Subject: 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. --- 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 d1887e325..9237df0fa 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