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 2016/10/17 09:57:24 UTC
[3/5] mesos git commit: Removed `flags::Flags` helper template.
Removed `flags::Flags` helper template.
The template `flags::Flags` allowed to compose flags classes on the
fly, e.g.,
flags::Flags<MyFlags1, MyFlags2> flags;
which would create a class inheriting virtually from both `MyFlags1`
and `MyFlags2`.
This class was not used in the code.
Review: https://reviews.apache.org/r/52604/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/da2aa2c1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/da2aa2c1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/da2aa2c1
Branch: refs/heads/master
Commit: da2aa2c14796b64b19002b86b3b6b9a443479ba8
Parents: e9888d1
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Oct 14 18:55:55 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Mon Oct 17 05:34:41 2016 -0400
----------------------------------------------------------------------
3rdparty/stout/include/stout/flags.hpp | 4 +++-
3rdparty/stout/include/stout/flags/flags.hpp | 20 --------------------
3rdparty/stout/tests/flags_tests.cpp | 11 +++++------
3 files changed, 8 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/da2aa2c1/3rdparty/stout/include/stout/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/flags.hpp b/3rdparty/stout/include/stout/flags.hpp
index 21257b7..b23b6f6 100644
--- a/3rdparty/stout/include/stout/flags.hpp
+++ b/3rdparty/stout/include/stout/flags.hpp
@@ -55,7 +55,9 @@
// You can also compose flags provided that each has used "virtual
// inheritance":
// -------------------------------------------------------------
-// Flags<MyFlags1, MyFlags2> flags;
+// class MyFlags : public virtual MyFlags1, public virtual MyFlags2 {};
+//
+// MyFlags flags;
// flags.add(...); // Any other flags you want to throw in there.
// flags.load(values);
// flags.flag_from_myflags1 ...
http://git-wip-us.apache.org/repos/asf/mesos/blob/da2aa2c1/3rdparty/stout/include/stout/flags/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/flags/flags.hpp b/3rdparty/stout/include/stout/flags/flags.hpp
index 794a598..3c2ad4a 100644
--- a/3rdparty/stout/include/stout/flags/flags.hpp
+++ b/3rdparty/stout/include/stout/flags/flags.hpp
@@ -17,8 +17,6 @@
#include <map>
#include <ostream>
#include <string>
-#include <tuple>
-#include <type_traits>
#include <typeinfo> // For typeid.
#include <vector>
@@ -402,24 +400,6 @@ private:
};
-template <typename... FlagsTypes>
-class Flags : public virtual FlagsTypes...
-{
- // Construct tuple types of sizeof...(FlagsTypes) compile-time bools to check
- // non-recursively that all FlagsTypes derive from FlagsBase; as a helper we
- // use is_object<FlagTypes> to construct sizeof...(FlagTypes) true types for
- // the RHS (is_object<T> is a true type for anything one would inherit from).
- static_assert(
- std::is_same<
- std::tuple<typename std::is_base_of<FlagsBase, FlagsTypes>::type...>,
- std::tuple<typename std::is_object<FlagsTypes>::type...>>::value,
- "Can only instantiate Flags with FlagsBase types.");
-};
-
-template <>
-class Flags<> : public virtual FlagsBase {};
-
-
template <typename T1, typename T2, typename F>
void FlagsBase::add(
T1* t1,
http://git-wip-us.apache.org/repos/asf/mesos/blob/da2aa2c1/3rdparty/stout/tests/flags_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/flags_tests.cpp b/3rdparty/stout/tests/flags_tests.cpp
index 201b16a..50d7c17 100644
--- a/3rdparty/stout/tests/flags_tests.cpp
+++ b/3rdparty/stout/tests/flags_tests.cpp
@@ -33,7 +33,6 @@
#include <stout/tests/utils.hpp>
using flags::Flag;
-using flags::Flags;
using flags::FlagsBase;
using flags::Warnings;
@@ -112,7 +111,7 @@ TEST(FlagsTest, Load)
TEST(FlagsTest, Add)
{
- Flags<TestFlags> flags;
+ TestFlags flags;
Option<string> name6;
@@ -879,7 +878,7 @@ TEST(FlagsTest, OptionalMessage)
TEST(FlagsTest, Duration)
{
- Flags<TestFlags> flags;
+ TestFlags flags;
Duration name6;
@@ -909,7 +908,7 @@ TEST(FlagsTest, Duration)
TEST(FlagsTest, JSON)
{
- Flags<TestFlags> flags;
+ TestFlags flags;
Option<JSON::Object> json;
@@ -944,7 +943,7 @@ class FlagsFileTest : public TemporaryDirectoryTest {};
// assumes filesystems are rooted at '/'. See MESOS-5937.
TEST_F_TEMP_DISABLED_ON_WINDOWS(FlagsFileTest, JSONFile)
{
- Flags<TestFlags> flags;
+ TestFlags flags;
Option<JSON::Object> json;
@@ -979,7 +978,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FlagsFileTest, JSONFile)
TEST_F(FlagsFileTest, FilePrefix)
{
- Flags<TestFlags> flags;
+ TestFlags flags;
Option<string> something;