From b88bb0654b534dcb2d9035ddf20167eeb18f138b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 23 Oct 2016 18:14:03 +0300 Subject: [PATCH 1/2] g++ at 5.4.0 still doesn't like mp_valid --- test/mp_valid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/mp_valid.cpp b/test/mp_valid.cpp index 228d42e..65ecb9c 100644 --- a/test/mp_valid.cpp +++ b/test/mp_valid.cpp @@ -48,8 +48,8 @@ int main() #endif BOOST_TEST_TRAIT_FALSE((mp_valid)); -#if !defined( BOOST_GCC ) || !BOOST_WORKAROUND( BOOST_GCC, <= 40902 ) - // g++ 4.9.2 doesn't like add_reference for some reason or other +#if !defined( BOOST_GCC ) || !BOOST_WORKAROUND( BOOST_GCC, < 50500 ) + // g++ up to at least 5.4 doesn't like add_reference for some reason or other BOOST_TEST_TRAIT_FALSE((mp_valid)); #if !defined( BOOST_MSVC ) || !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 ) // msvc-12.0 gives an internal error here From 37f088a5bc67e9497c7859816ec7599c78e34a98 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 23 Oct 2016 18:16:55 +0300 Subject: [PATCH 2/2] Boost.Config no longer defines BOOST_NO_CXX11_CONSTEXPR for VS2015u3 --- include/boost/mp11/algorithm.hpp | 9 +++++---- include/boost/mp11/detail/config.hpp | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 include/boost/mp11/detail/config.hpp diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index b0c2450..7c601b4 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -100,7 +101,7 @@ namespace detail template struct mp_count_impl; -#if !defined( BOOST_NO_CXX11_CONSTEXPR ) +#if !defined( BOOST_MP11_NO_CONSTEXPR ) constexpr std::size_t cx_plus() { @@ -136,7 +137,7 @@ namespace detail template class P> struct mp_count_if_impl; -#if !defined( BOOST_NO_CXX11_CONSTEXPR ) +#if !defined( BOOST_MP11_NO_CONSTEXPR ) template class L, class... T, template class P> struct mp_count_if_impl, P> { @@ -542,7 +543,7 @@ namespace detail template struct mp_find_index_impl; -#if !defined( BOOST_NO_CXX11_CONSTEXPR ) +#if !defined( BOOST_MP11_NO_CONSTEXPR ) template class L, class V> struct mp_find_index_impl, V> { @@ -602,7 +603,7 @@ namespace detail template class P> struct mp_find_index_if_impl; -#if !defined( BOOST_NO_CXX11_CONSTEXPR ) +#if !defined( BOOST_MP11_NO_CONSTEXPR ) template class L, template class P> struct mp_find_index_if_impl, P> { diff --git a/include/boost/mp11/detail/config.hpp b/include/boost/mp11/detail/config.hpp new file mode 100644 index 0000000..47cc3ba --- /dev/null +++ b/include/boost/mp11/detail/config.hpp @@ -0,0 +1,24 @@ +#ifndef BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED +#define BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED + +// Copyright 2016 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +#if defined( BOOST_NO_CXX11_CONSTEXPR ) + +# define BOOST_MP11_NO_CONSTEXPR + +#elif defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1900 ) + +# define BOOST_MP11_NO_CONSTEXPR + +#endif + +#endif // #ifndef BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED