[prev in list] [next in list] [prev in thread] [next in thread]
List: mesos-commits
Subject: [2/2] git commit: Add some relation operators to os::Release
From: idownes () apache ! org
Date: 2014-06-26 0:14:38
Message-ID: 25e30f8d54a94311b518270f2c8fbca5 () git ! apache ! org
[Download RAW message or body]
Add some relation operators to os::Release
Review: https://reviews.apache.org/r/22897
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/50e1b120
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/50e1b120
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/50e1b120
Branch: refs/heads/master
Commit: 50e1b120578e1626daba630515218fea27acc340
Parents: e878c74
Author: Ian Downes <idownes@twitter.com>
Authored: Mon Jun 23 16:12:52 2014 -0700
Committer: Ian Downes <idownes@twitter.com>
Committed: Wed Jun 25 17:13:47 2014 -0700
----------------------------------------------------------------------
.../3rdparty/stout/include/stout/os.hpp | 24 ++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/50e1b120/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp \
b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp index 0529f88..0825172 \
100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -1129,6 +1129,30 @@ inline Try<std::string> sysname()
// The OS release level.
struct Release
{
+ bool operator == (const Release& other)
+ {
+ return version == other.version &&
+ major == other.major &&
+ minor == other.minor;
+ }
+
+ bool operator < (const Release& other)
+ {
+ // Lexicographic ordering.
+ if (version != other.version) {
+ return version < other.version;
+ } else if (major != other.major) {
+ return major < other.major;
+ } else {
+ return minor < other.minor;
+ }
+ }
+
+ bool operator <= (const Release& other)
+ {
+ return *this < other || *this == other;
+ }
+
int version;
int major;
int minor;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic