You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/04/26 21:43:42 UTC

[09/10] mesos git commit: Switched from 'tuples::' to 'std::' in libprocess.

Switched from 'tuples::' to 'std::' in libprocess.

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


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

Branch: refs/heads/master
Commit: 6b8d32672f3ea4da6a3f1a834af153dd85f126d0
Parents: 2666e7b
Author: Michael Park <mc...@gmail.com>
Authored: Sun Apr 26 12:26:10 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Sun Apr 26 12:26:10 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/collect.hpp | 14 ++++----
 3rdparty/libprocess/src/tests/process_tests.cpp | 38 ++++++++++----------
 2 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6b8d3267/3rdparty/libprocess/include/process/collect.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/collect.hpp b/3rdparty/libprocess/include/process/collect.hpp
index ca220c3..1f10a92 100644
--- a/3rdparty/libprocess/include/process/collect.hpp
+++ b/3rdparty/libprocess/include/process/collect.hpp
@@ -2,6 +2,7 @@
 #define __PROCESS_COLLECT_HPP__
 
 #include <list>
+#include <tuple>
 
 #include <process/check.hpp>
 #include <process/defer.hpp>
@@ -10,7 +11,6 @@
 #include <process/process.hpp>
 
 #include <stout/lambda.hpp>
-#include <stout/tuple.hpp>
 
 // TODO(bmahler): Move these into a futures.hpp header to group Future
 // related utilities.
@@ -35,13 +35,13 @@ Future<std::list<Future<T>>> await(const std::list<Future<T>>& futures);
 // typed of a tuple of futures.
 // TODO(jieyu): Investigate the use of variadic templates here.
 template <typename T1, typename T2>
-Future<tuples::tuple<Future<T1>, Future<T2>>> await(
+Future<std::tuple<Future<T1>, Future<T2>>> await(
     const Future<T1>& future1,
     const Future<T2>& future2);
 
 
 template <typename T1, typename T2, typename T3>
-Future<tuples::tuple<Future<T1>, Future<T2>, Future<T3>>> await(
+Future<std::tuple<Future<T1>, Future<T2>, Future<T3>>> await(
     const Future<T1>& future1,
     const Future<T2>& future2,
     const Future<T3>& future3);
@@ -197,7 +197,7 @@ inline Future<std::list<Future<T>>> await(
 
 
 template <typename T1, typename T2>
-Future<tuples::tuple<Future<T1>, Future<T2>>> await(
+Future<std::tuple<Future<T1>, Future<T2>>> await(
     const Future<T1>& future1,
     const Future<T2>& future2)
 {
@@ -212,12 +212,12 @@ Future<tuples::tuple<Future<T1>, Future<T2>>> await(
   futures.push_back(promise2->future());
 
   return await(futures)
-    .then([=] () { return tuples::make_tuple(future1, future2); });
+    .then([=] () { return std::make_tuple(future1, future2); });
 }
 
 
 template <typename T1, typename T2, typename T3>
-Future<tuples::tuple<Future<T1>, Future<T2>, Future<T3>>> await(
+Future<std::tuple<Future<T1>, Future<T2>, Future<T3>>> await(
     const Future<T1>& future1,
     const Future<T2>& future2,
     const Future<T3>& future3)
@@ -236,7 +236,7 @@ Future<tuples::tuple<Future<T1>, Future<T2>, Future<T3>>> await(
   futures.push_back(promise3->future());
 
   return await(futures)
-    .then([=] () { return tuples::make_tuple(future1, future2, future3); });
+    .then([=] () { return std::make_tuple(future1, future2, future3); });
 }
 
 } // namespace process {

http://git-wip-us.apache.org/repos/asf/mesos/blob/6b8d3267/3rdparty/libprocess/src/tests/process_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/process_tests.cpp b/3rdparty/libprocess/src/tests/process_tests.cpp
index 7c2cb4b..b6c6c51 100644
--- a/3rdparty/libprocess/src/tests/process_tests.cpp
+++ b/3rdparty/libprocess/src/tests/process_tests.cpp
@@ -7,6 +7,7 @@
 
 #include <string>
 #include <sstream>
+#include <tuple>
 
 #include <process/async.hpp>
 #include <process/collect.hpp>
@@ -35,7 +36,6 @@
 #include <stout/stringify.hpp>
 #include <stout/stopwatch.hpp>
 #include <stout/try.hpp>
-#include <stout/tuple.hpp>
 
 #include "encoder.hpp"
 
@@ -1117,7 +1117,7 @@ TEST(Process, select)
   Promise<int> promise3;
   Promise<int> promise4;
 
-  std::set<Future<int> > futures;
+  std::set<Future<int>> futures;
   futures.insert(promise1.future());
   futures.insert(promise2.future());
   futures.insert(promise3.future());
@@ -1125,7 +1125,7 @@ TEST(Process, select)
 
   promise1.set(42);
 
-  Future<Future<int> > future = select(futures);
+  Future<Future<int>> future = select(futures);
 
   AWAIT_READY(future);
   AWAIT_READY(future.get());
@@ -1146,8 +1146,8 @@ TEST(Process, collect)
   ASSERT_TRUE(GTEST_IS_THREADSAFE);
 
   // First ensure an empty list functions correctly.
-  std::list<Future<int> > empty;
-  Future<std::list<int> > future = collect(empty);
+  std::list<Future<int>> empty;
+  Future<std::list<int>> future = collect(empty);
   AWAIT_ASSERT_READY(future);
   EXPECT_TRUE(future.get().empty());
 
@@ -1156,7 +1156,7 @@ TEST(Process, collect)
   Promise<int> promise3;
   Promise<int> promise4;
 
-  std::list<Future<int> > futures;
+  std::list<Future<int>> futures;
   futures.push_back(promise1.future());
   futures.push_back(promise2.future());
   futures.push_back(promise3.future());
@@ -1189,8 +1189,8 @@ TEST(Process, await1)
   ASSERT_TRUE(GTEST_IS_THREADSAFE);
 
   // First ensure an empty list functions correctly.
-  std::list<Future<int> > empty;
-  Future<std::list<Future<int> > > future = await(empty);
+  std::list<Future<int>> empty;
+  Future<std::list<Future<int>>> future = await(empty);
   AWAIT_ASSERT_READY(future);
   EXPECT_TRUE(future.get().empty());
 
@@ -1199,7 +1199,7 @@ TEST(Process, await1)
   Promise<int> promise3;
   Promise<int> promise4;
 
-  std::list<Future<int> > futures;
+  std::list<Future<int>> futures;
   futures.push_back(promise1.future());
   futures.push_back(promise2.future());
   futures.push_back(promise3.future());
@@ -1232,7 +1232,7 @@ TEST(Process, await2)
   Promise<int> promise1;
   Promise<bool> promise2;
 
-  Future<tuples::tuple<Future<int>, Future<bool> > > future =
+  Future<std::tuple<Future<int>, Future<bool>>> future =
     await(promise1.future(), promise2.future());
   ASSERT_TRUE(future.isPending());
 
@@ -1244,12 +1244,12 @@ TEST(Process, await2)
 
   AWAIT_READY(future);
 
-  tuples::tuple<Future<int>, Future<bool> > futures = future.get();
+  std::tuple<Future<int>, Future<bool>> futures = future.get();
 
-  ASSERT_TRUE(tuples::get<0>(futures).isReady());
-  ASSERT_EQ(42, tuples::get<0>(futures).get());
+  ASSERT_TRUE(std::get<0>(futures).isReady());
+  ASSERT_EQ(42, std::get<0>(futures).get());
 
-  ASSERT_TRUE(tuples::get<1>(futures).isFailed());
+  ASSERT_TRUE(std::get<1>(futures).isFailed());
 }
 
 
@@ -1258,7 +1258,7 @@ TEST(Process, await3)
   Promise<int> promise1;
   Promise<bool> promise2;
 
-  Future<tuples::tuple<Future<int>, Future<bool> > > future =
+  Future<std::tuple<Future<int>, Future<bool>>> future =
     await(promise1.future(), promise2.future());
   ASSERT_TRUE(future.isPending());
 
@@ -1270,12 +1270,12 @@ TEST(Process, await3)
 
   AWAIT_READY(future);
 
-  tuples::tuple<Future<int>, Future<bool> > futures = future.get();
+  std::tuple<Future<int>, Future<bool>> futures = future.get();
 
-  ASSERT_TRUE(tuples::get<0>(futures).isReady());
-  ASSERT_EQ(42, tuples::get<0>(futures).get());
+  ASSERT_TRUE(std::get<0>(futures).isReady());
+  ASSERT_EQ(42, std::get<0>(futures).get());
 
-  ASSERT_TRUE(tuples::get<1>(futures).isDiscarded());
+  ASSERT_TRUE(std::get<1>(futures).isDiscarded());
 }