Added move constructor/assignment to `Try`. Review: https://reviews.apache.org/r/47988/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6ce7279b Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6ce7279b Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6ce7279b Branch: refs/heads/master Commit: 6ce7279b2399a02f524692ff5799d637b99b38ff Parents: ae53e3b Author: Anand Mazumdar <mazumdar.an...@gmail.com> Authored: Tue May 31 13:28:51 2016 -0600 Committer: Vinod Kone <vinodk...@gmail.com> Committed: Tue May 31 13:28:51 2016 -0600 ---------------------------------------------------------------------- 3rdparty/stout/include/stout/try.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/6ce7279b/3rdparty/stout/include/stout/try.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/try.hpp b/3rdparty/stout/include/stout/try.hpp index 89dedec..5b38494 100644 --- a/3rdparty/stout/include/stout/try.hpp +++ b/3rdparty/stout/include/stout/try.hpp @@ -52,13 +52,15 @@ public: Try(const E& error) : error_(error) {} - // TODO(bmahler): Add move constructor. + Try(T&& t) + : data(Some(std::move(t))) {} // We don't need to implement these because we are leveraging // Option<T>. Try(const Try& that) = default; ~Try() = default; Try& operator=(const Try& that) = default; + Try& operator=(Try&& that) = default; // 'isSome' and 'isError' are mutually exclusive. They correspond // to the underlying state of the Option.