Repository: mesos
Updated Branches:
  refs/heads/master 88c37a2a5 -> beac384c7


Add mutable get() to Try<T>.

Review: https://reviews.apache.org/r/35962


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/aadf4a78
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/aadf4a78
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/aadf4a78

Branch: refs/heads/master
Commit: aadf4a78a73731ba02bc4d2e6a7d9c41a7bb352d
Parents: 88c37a2
Author: Joris Van Remoortere <[email protected]>
Authored: Fri Jun 26 18:30:02 2015 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Fri Jun 26 18:30:02 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/aadf4a78/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 
b/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp
index bf1540b..5ad6114 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp
@@ -79,6 +79,14 @@ public:
     return data.get();
   }
 
+  T& get()
+  {
+    if (!data.isSome()) {
+      ABORT("Try::get() but state == ERROR: " + message);
+    }
+    return data.get();
+  }
+
   const std::string& error() const { assert(data.isNone()); return message; }
 
 private:

Reply via email to