mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject mesos git commit: Added `is_specialization_of` trait.
Date Fri, 01 Sep 2017 05:40:21 GMT
Repository: mesos
Updated Branches:
  refs/heads/1.4.x 5a51deb2f -> 3293e4a61


Added `is_specialization_of` trait.

This trait can be used to determine if some type `T` is a
specialization of a template type, e.g., if `T` is a specialization of
`Future` or `Try`.


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

Branch: refs/heads/1.4.x
Commit: 3293e4a6186109417a82ac4626a21e2cb335403c
Parents: 5a51deb
Author: Benjamin Hindman <benjamin.hindman@gmail.com>
Authored: Tue Aug 29 23:03:33 2017 -0700
Committer: Jie Yu <yujie.jay@gmail.com>
Committed: Thu Aug 31 22:33:07 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/traits.hpp | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3293e4a6/3rdparty/stout/include/stout/traits.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/traits.hpp b/3rdparty/stout/include/stout/traits.hpp
index 434b8fe..5dea084 100644
--- a/3rdparty/stout/include/stout/traits.hpp
+++ b/3rdparty/stout/include/stout/traits.hpp
@@ -13,6 +13,13 @@
 #ifndef __STOUT_TRAITS_HPP__
 #define __STOUT_TRAITS_HPP__
 
+template <template <typename...> class T, typename U>
+struct is_specialization_of : std::false_type {};
+
+template <template <typename...> class T, typename... Args>
+struct is_specialization_of<T, T<Args...>> : std::true_type {};
+
+
 // Lambda (or functor) traits.
 template <typename T>
 struct LambdaTraits : public LambdaTraits<decltype(&T::operator())> {};


Mime
View raw message