From 0e0d7fae4ec7a0da71f691376419b5b0b5706da8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 24 May 2017 06:16:17 +0300 Subject: [PATCH] Enable fold expressions on g++ --- include/boost/mp11/algorithm.hpp | 4 ++-- include/boost/mp11/detail/config.hpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 9f0a6f7..e31e3b7 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -499,7 +499,7 @@ namespace detail template struct mp_find_impl; -#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) +#if defined( BOOST_CLANG ) && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) struct mp_index_holder { @@ -589,7 +589,7 @@ namespace detail template class P> struct mp_find_if_impl; -#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) +#if defined( BOOST_CLANG ) && defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) template class L, class... T, template class P> struct mp_find_if_impl, P> { diff --git a/include/boost/mp11/detail/config.hpp b/include/boost/mp11/detail/config.hpp index 75c5caa..a152f46 100644 --- a/include/boost/mp11/detail/config.hpp +++ b/include/boost/mp11/detail/config.hpp @@ -21,7 +21,11 @@ #endif -#if defined(BOOST_CLANG) && defined(__has_cpp_attribute) +#if defined(__cpp_fold_expressions) && __cpp_fold_expressions >= 201603 + +# define BOOST_MP11_HAS_FOLD_EXPRESSIONS + +#elif defined(BOOST_CLANG) && defined(__has_cpp_attribute) # if __has_cpp_attribute(fallthrough) && __cplusplus >= 201406L // Clang 3.9+ in c++1z mode # define BOOST_MP11_HAS_FOLD_EXPRESSIONS