From 523c23619c632d57bd17076544c8f010bace3c01 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 7 Dec 2019 20:52:18 +0200 Subject: [PATCH] Use a better msvc-12/14 workaround in test/mp_unique_if.cpp --- test/mp_unique_if.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/mp_unique_if.cpp b/test/mp_unique_if.cpp index 705e91a..d409a19 100644 --- a/test/mp_unique_if.cpp +++ b/test/mp_unique_if.cpp @@ -17,9 +17,18 @@ using boost::mp11::mp_bool; +#if !BOOST_MP11_WORKAROUND( BOOST_MSVC, < 1910 ) + template using Eq1 = mp_bool< T::value == U::value >; template using Eq2 = mp_bool< sizeof(T) == sizeof(U) >; +#else + +template struct Eq1: mp_bool< T::value == U::value > {}; +template struct Eq2: mp_bool< sizeof(T) == sizeof(U) > {}; + +#endif + int main() { using boost::mp11::mp_list; @@ -66,15 +75,11 @@ int main() using R1 = mp_unique_if; BOOST_TEST_TRAIT_TRUE((std::is_same)); -#if !BOOST_MP11_WORKAROUND( BOOST_MSVC, < 1910 ) - using R2 = mp_unique_if; BOOST_TEST_TRAIT_TRUE((std::is_same)); using R3 = mp_unique_if; BOOST_TEST_TRAIT_TRUE((std::is_same>>)); - -#endif } { @@ -87,21 +92,13 @@ int main() using L2 = mp_list_c; using L3 = mp_list_c; -#if !BOOST_MP11_WORKAROUND( BOOST_MSVC, < 1910 ) - using R1 = mp_unique_if, Eq1>; BOOST_TEST_TRAIT_TRUE((std::is_same, std::integral_constant>>)); - -#endif } { -#if !BOOST_MP11_WORKAROUND( BOOST_MSVC, < 1910 ) - BOOST_TEST_TRAIT_TRUE((std::is_same, Eq2>, std::tuple>)); BOOST_TEST_TRAIT_TRUE((std::is_same, Eq2>, std::tuple>)); - -#endif } return boost::report_errors();