From f9eab3f72b3ba1257b7571243002c1b1d498bd84 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 24 Mar 2017 20:07:20 +0200 Subject: [PATCH 1/5] Add g++ 4.8, OS X -std=c++1z to Travis --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 48fc3f0..225411e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,15 @@ matrix: - env: BOGUS_JOB=true include: + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11 + addons: + apt: + packages: + - g++-4.8 + sources: + - ubuntu-toolchain-r-test + - os: linux env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11 addons: @@ -177,6 +186,9 @@ matrix: - os: osx env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z + install: - cd .. - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root From 48feceb5513c15244111e00c6310c0a9a30685b3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 24 Mar 2017 20:42:41 +0200 Subject: [PATCH 2/5] Add g++ 4.7 to Travis --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 225411e..bd99c4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,15 @@ matrix: - env: BOGUS_JOB=true include: + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11 + addons: + apt: + packages: + - g++-4.7 + sources: + - ubuntu-toolchain-r-test + - os: linux env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11 addons: From 6332db40abca3606a9cdfd06288923cd68b02d17 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 24 Mar 2017 21:07:23 +0200 Subject: [PATCH 3/5] Try a g++ 4.7 workaround --- test/mp_defer.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/mp_defer.cpp b/test/mp_defer.cpp index 492e32b..2178493 100644 --- a/test/mp_defer.cpp +++ b/test/mp_defer.cpp @@ -1,5 +1,5 @@ -// Copyright 2015 Peter Dimov. +// Copyright 2015-2017 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include using boost::mp11::mp_identity; @@ -23,7 +25,15 @@ template struct has_type using type = decltype( f(0) ); +#if BOOST_WORKAROUND( BOOST_GCC, < 40800 ) + + static constexpr auto value = type::value; + +#else + static const auto value = type::value; + +#endif }; using boost::mp11::mp_defer; From 8999977bdde67511815177ed898891c55cb48c4f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 24 Mar 2017 21:27:33 +0200 Subject: [PATCH 4/5] Try another g++ 4.7 workaround --- test/mp_defer.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test/mp_defer.cpp b/test/mp_defer.cpp index 2178493..75f3128 100644 --- a/test/mp_defer.cpp +++ b/test/mp_defer.cpp @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include using boost::mp11::mp_identity; @@ -25,15 +23,7 @@ template struct has_type using type = decltype( f(0) ); -#if BOOST_WORKAROUND( BOOST_GCC, < 40800 ) - - static constexpr auto value = type::value; - -#else - - static const auto value = type::value; - -#endif + static const bool value = type::value; }; using boost::mp11::mp_defer; From c21636d2ce4b73a4d1e8001c2edec1b994e2e78d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 24 Mar 2017 21:53:57 +0200 Subject: [PATCH 5/5] More g++ 4.7 workarounds --- test/mp_fold.cpp | 13 ++++++++++++- test/mp_reverse.cpp | 13 ++++++++++++- test/mp_reverse_fold.cpp | 13 ++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/test/mp_fold.cpp b/test/mp_fold.cpp index 96dd7ba..de4ec9a 100644 --- a/test/mp_fold.cpp +++ b/test/mp_fold.cpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include @@ -21,6 +23,16 @@ struct X4 {}; template struct F {}; +#if BOOST_WORKAROUND( BOOST_GCC, < 40800 ) + +template using mp_plus = std::integral_constant::type, A::value + B::value>; + +#else + +using boost::mp11::mp_plus; + +#endif + int main() { using boost::mp11::mp_list; @@ -57,7 +69,6 @@ int main() using boost::mp11::mp_iota_c; using boost::mp11::mp_reverse; using boost::mp11::mp_size_t; - using boost::mp11::mp_plus; { int const N = 37; diff --git a/test/mp_reverse.cpp b/test/mp_reverse.cpp index e1aebf5..0035808 100644 --- a/test/mp_reverse.cpp +++ b/test/mp_reverse.cpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include @@ -27,6 +29,16 @@ struct X10 {}; struct X11 {}; struct X12 {}; +#if BOOST_WORKAROUND( BOOST_GCC, < 40800 ) + +template using mp_plus = std::integral_constant::type, A::value + B::value>; + +#else + +using boost::mp11::mp_plus; + +#endif + int main() { using boost::mp11::mp_list; @@ -71,7 +83,6 @@ int main() using boost::mp11::mp_iota_c; using boost::mp11::mp_size_t; using boost::mp11::mp_transform; - using boost::mp11::mp_plus; using boost::mp11::mp_fill; { diff --git a/test/mp_reverse_fold.cpp b/test/mp_reverse_fold.cpp index 0556bee..820f64b 100644 --- a/test/mp_reverse_fold.cpp +++ b/test/mp_reverse_fold.cpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include @@ -27,6 +29,16 @@ using boost::mp11::mp_push_front; template using rev_push_back = mp_push_back; template using rev_push_front = mp_push_front; +#if BOOST_WORKAROUND( BOOST_GCC, < 40800 ) + +template using mp_plus = std::integral_constant::type, A::value + B::value>; + +#else + +using boost::mp11::mp_plus; + +#endif + int main() { using boost::mp11::mp_list; @@ -59,7 +71,6 @@ int main() using boost::mp11::mp_iota_c; using boost::mp11::mp_reverse; using boost::mp11::mp_size_t; - using boost::mp11::mp_plus; { int const N = 37;