You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/01/15 21:55:40 UTC

mesos git commit: Stout: Added ref-qualifiers to Option::get().

Repository: mesos
Updated Branches:
  refs/heads/master 67ce61e65 -> 17ea110be


Stout: Added ref-qualifiers to Option::get().

This trivial change adds ref-qualifiers introduced in C++11 to
'Option::get()'. This is in sync with what boost/folly `optional`
already has.

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


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

Branch: refs/heads/master
Commit: 17ea110bee19467a4552090cf4e13d0e3c481ee5
Parents: 67ce61e
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Fri Jan 15 15:13:00 2016 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Fri Jan 15 15:54:04 2016 -0500

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/17ea110b/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp
index b58350b..a3dc769 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp
@@ -105,8 +105,10 @@ public:
   bool isSome() const { return state == SOME; }
   bool isNone() const { return state == NONE; }
 
-  const T& get() const { assert(isSome()); return t; }
-  T& get() { assert(isSome()); return t; }
+  const T& get() const & { assert(isSome()); return t; }
+  T& get() & { assert(isSome()); return t; }
+  T&& get() && { assert(isSome()); return std::move(t); }
+  const T&& get() const && { assert(isSome()); return std::move(t); }
 
   const T* operator->() const { return &get(); }
   T* operator->() { return &get(); }