You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by dm...@apache.org on 2014/09/17 22:47:21 UTC
git commit: Check for variadic template support
Repository: mesos
Updated Branches:
refs/heads/master 3b9b4256a -> 82e886c91
Check for variadic template support
Review: https://reviews.apache.org/r/25261
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/82e886c9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/82e886c9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/82e886c9
Branch: refs/heads/master
Commit: 82e886c91d15c166e93ebc248028f97eba340fa7
Parents: 3b9b425
Author: Dominic Hamon <dh...@twitter.com>
Authored: Tue Sep 2 10:52:03 2014 -0700
Committer: Dominic Hamon <dh...@twitter.com>
Committed: Wed Sep 17 13:46:26 2014 -0700
----------------------------------------------------------------------
docs/mesos-c++-style-guide.md | 8 ++++++++
m4/ax_cxx_compile_stdcxx_11.m4 | 16 ++++++++--------
2 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/82e886c9/docs/mesos-c++-style-guide.md
----------------------------------------------------------------------
diff --git a/docs/mesos-c++-style-guide.md b/docs/mesos-c++-style-guide.md
index 4381d24..59a39df 100644
--- a/docs/mesos-c++-style-guide.md
+++ b/docs/mesos-c++-style-guide.md
@@ -82,3 +82,11 @@ Try<Duration> failoverTimeout =
* 1 blank line at the end of the file.
* Elements outside classes (classes, structs, global functions, etc.) should be spaced apart by 2 blank lines.
* Elements inside classes (member variables and functions) should not be spaced apart by more than 1 blank line.
+
+## C++11
+We still support older compilers. The whitelist of supported C++11 features is:
+* Static assertions.
+* Multiple right angle brackets.
+* Type inference (`auto` and `decltype`).
+* Rvalue references.
+* Variadic templates.
http://git-wip-us.apache.org/repos/asf/mesos/blob/82e886c9/m4/ax_cxx_compile_stdcxx_11.m4
----------------------------------------------------------------------
diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
index 07b298f..d4b6628 100644
--- a/m4/ax_cxx_compile_stdcxx_11.m4
+++ b/m4/ax_cxx_compile_stdcxx_11.m4
@@ -36,22 +36,22 @@
#serial 3
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
- template <typename T>
+ template <typename T, typename ...Args>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
- typedef check<check<bool>> right_angle_brackets;
+ typedef check<check<bool>> right_angle_brackets;
- int a;
- decltype(a) b;
+ int a;
+ decltype(a) b;
- typedef check<int> check_type;
- check_type c;
- check_type&& cr = static_cast<check_type&&>(c);
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = static_cast<check_type&&>(c);
- auto d = a;
+ auto d = a;
])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [