From f03c36bde6a43ad84ae412d46b3e466de82fab6e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 21 Jan 2019 17:57:03 +0300 Subject: Add standard_version::latest_snapshot() predicate --- libbutl/standard-version.ixx | 6 ++++++ libbutl/standard-version.mxx | 1 + 2 files changed, 7 insertions(+) diff --git a/libbutl/standard-version.ixx b/libbutl/standard-version.ixx index 40ca623..c0833c4 100644 --- a/libbutl/standard-version.ixx +++ b/libbutl/standard-version.ixx @@ -80,6 +80,12 @@ namespace butl return version % 10000 == 1 && !snapshot () && !stub (); } + inline bool standard_version:: + latest_snapshot () const noexcept + { + return snapshot () && snapshot_sn == latest_sn; + } + // Note: in the following constructors we subtract one from AAABBBCCC if // DDDE is not zero (see standard-version.hxx for details). // diff --git a/libbutl/standard-version.mxx b/libbutl/standard-version.mxx index b71a44b..6688237 100644 --- a/libbutl/standard-version.mxx +++ b/libbutl/standard-version.mxx @@ -134,6 +134,7 @@ LIBBUTL_MODEXPORT namespace butl bool earliest () const noexcept; bool release () const noexcept; bool snapshot () const noexcept {return snapshot_sn != 0;} + bool latest_snapshot () const noexcept; bool final () const noexcept; // Comparison of empty or stub versions doesn't make sense. -- cgit v1.1