Add one additional test for mp_any that exposes an issue with msvc-14.1/cxxstd=17

This commit is contained in:
Peter Dimov
2019-01-07 20:21:14 +02:00
parent 16c6f93cff
commit 27b2ebdbff
2 changed files with 11 additions and 2 deletions

View File

@@ -125,7 +125,7 @@ template<class T1, class... T> struct mp_or_impl<T1, T...>
} // namespace detail
// mp_any<T...>
#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<class... T> using mp_any = mp_bool<(static_cast<bool>(T::value) || ...)>;

View File

@@ -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 <boost/mp11/function.hpp>
#include <boost/mp11/integral.hpp>
#include <boost/mp11/set.hpp>
#include <boost/mp11/detail/config.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <type_traits>
@@ -27,6 +28,10 @@ template<class... T> using variant_base = variant_base_impl<mp_all<std::has_triv
template<class... T> using variant_base = variant_base_impl<mp_all<std::is_trivially_destructible<T>...>::value, mp_any<mp_all<std::is_nothrow_move_constructible<T>...>, std::is_nothrow_default_constructible<T>...>::value, T...>;
#endif
using boost::mp11::mp_set_contains;
template<class T, class... S> using in_any_set = mp_any< mp_set_contains<S, T>... >;
int main()
{
using boost::mp11::mp_true;
@@ -78,5 +83,9 @@ int main()
variant_base<void, int, float>();
using boost::mp11::mp_list;
BOOST_TEST_TRAIT_TRUE((std::is_same<in_any_set<void, mp_list<void>, mp_list<int>>, mp_true>));
return boost::report_errors();
}