From 27b2ebdbff119f77dd613520a57124dfb040aa5a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Jan 2019 20:21:14 +0200 Subject: [PATCH] Add one additional test for mp_any that exposes an issue with msvc-14.1/cxxstd=17 --- include/boost/mp11/function.hpp | 2 +- test/mp_any.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/boost/mp11/function.hpp b/include/boost/mp11/function.hpp index 005bc58..302ef2f 100644 --- a/include/boost/mp11/function.hpp +++ b/include/boost/mp11/function.hpp @@ -125,7 +125,7 @@ template struct mp_or_impl } // namespace detail // mp_any -#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 80200 ) +#if defined( BOOST_MP11_HAS_FOLD_EXPRESSIONS ) && !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 80200 ) && !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 ) template using mp_any = mp_bool<(static_cast(T::value) || ...)>; diff --git a/test/mp_any.cpp b/test/mp_any.cpp index cd0f247..9376050 100644 --- a/test/mp_any.cpp +++ b/test/mp_any.cpp @@ -1,5 +1,5 @@ -// Copyright 2015, 2016 Peter Dimov. +// Copyright 2015, 2016, 2019 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -27,6 +28,10 @@ template using variant_base = variant_base_impl using variant_base = variant_base_impl...>::value, mp_any...>, std::is_nothrow_default_constructible...>::value, T...>; #endif +using boost::mp11::mp_set_contains; + +template using in_any_set = mp_any< mp_set_contains... >; + int main() { using boost::mp11::mp_true; @@ -78,5 +83,9 @@ int main() variant_base(); + using boost::mp11::mp_list; + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list>, mp_true>)); + return boost::report_errors(); }