You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2018/01/10 17:24:08 UTC
[1/2] mesos git commit: Fixed the order of parameters of
`is_specialization_of` in stout.
Repository: mesos
Updated Branches:
refs/heads/master 51a3bd95b -> ab519aaa6
Fixed the order of parameters of `is_specialization_of` in stout.
Given `std::is_base_of<T, U>`, the interpretation of the question is:
"is `T` base of `U`?". Similarly, in this case want to ask the question
"is some type a specialization of a template?" As such, the order of
template paramters should be `is_specialization_of<Type, Template>`.
Review: https://reviews.apache.org/r/65054
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3b0d1fa2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3b0d1fa2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3b0d1fa2
Branch: refs/heads/master
Commit: 3b0d1fa2b652047af19471ead5eb228675427484
Parents: 51a3bd9
Author: Michael Park <mp...@apache.org>
Authored: Fri Jan 5 10:36:25 2018 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jan 10 09:14:04 2018 -0800
----------------------------------------------------------------------
3rdparty/stout/include/stout/traits.hpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3b0d1fa2/3rdparty/stout/include/stout/traits.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/traits.hpp b/3rdparty/stout/include/stout/traits.hpp
index 5dea084..270954e 100644
--- a/3rdparty/stout/include/stout/traits.hpp
+++ b/3rdparty/stout/include/stout/traits.hpp
@@ -13,11 +13,11 @@
#ifndef __STOUT_TRAITS_HPP__
#define __STOUT_TRAITS_HPP__
-template <template <typename...> class T, typename U>
+template <typename T, template <typename...> class C>
struct is_specialization_of : std::false_type {};
-template <template <typename...> class T, typename... Args>
-struct is_specialization_of<T, T<Args...>> : std::true_type {};
+template <template <typename...> class C, typename... Args>
+struct is_specialization_of<C<Args...>, C> : std::true_type {};
// Lambda (or functor) traits.
[2/2] mesos git commit: Fixed the order of parameters of
`is_specialization_of` in libprocess.
Posted by mp...@apache.org.
Fixed the order of parameters of `is_specialization_of` in libprocess.
Review: https://reviews.apache.org/r/65055
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ab519aaa
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ab519aaa
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ab519aaa
Branch: refs/heads/master
Commit: ab519aaa68bf71762c7d7f2f9aa7b6fb7b04a685
Parents: 3b0d1fa
Author: Michael Park <mp...@apache.org>
Authored: Fri Jan 5 10:36:31 2018 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jan 10 09:14:11 2018 -0800
----------------------------------------------------------------------
3rdparty/libprocess/include/process/future.hpp | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ab519aaa/3rdparty/libprocess/include/process/future.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/future.hpp b/3rdparty/libprocess/include/process/future.hpp
index 54fbbeb..2b8a059 100644
--- a/3rdparty/libprocess/include/process/future.hpp
+++ b/3rdparty/libprocess/include/process/future.hpp
@@ -1976,7 +1976,7 @@ struct UndiscardableDecorator
typename std::decay<decltype(f(std::forward<Args>(args)...))>::type;
static_assert(
- is_specialization_of<Future, Result>::value,
+ is_specialization_of<Result, Future>::value,
"Expecting Future<T> to be returned from undiscarded(...)");
return undiscardable(f(std::forward<Args>(args)...));
@@ -2000,11 +2000,10 @@ struct UndiscardableDecorator
// This guarantees that even if `future` is discarded the discard will
// not propagate into the lambda passed into `.then()`.
template <
- typename F,
- typename std::enable_if<
- !is_specialization_of<
- Future,
- typename std::decay<F>::type>::value, int>::type = 0>
+ typename F,
+ typename std::enable_if<
+ !is_specialization_of<typename std::decay<F>::type, Future>::value,
+ int>::type = 0>
UndiscardableDecorator<typename std::decay<F>::type> undiscardable(F&& f)
{
return UndiscardableDecorator<