// Copyright 2015 Peter Dimov. // Copyright 2019 Kris Jusiak. // // 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 #if BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40800 ) # pragma GCC diagnostic ignored "-Wsign-compare" #endif #include #include #include #include #include #include #include using boost::mp11::mp_bool; #if !BOOST_MP11_WORKAROUND( BOOST_MSVC, < 1910 ) struct Q1 { template using fn = mp_bool< T::value == U::value >; }; struct Q2 { template using fn = mp_bool< sizeof(T) == sizeof(U) >; }; #else struct Q1 { template struct fn: mp_bool< T::value == U::value > {}; }; struct Q2 { template struct fn: mp_bool< sizeof(T) == sizeof(U) > {}; }; #endif int main() { using boost::mp11::mp_list; using boost::mp11::mp_unique_if_q; using boost::mp11::mp_quote_trait; { using boost::mp11::mp_iota_c; using boost::mp11::mp_size_t; using L1 = mp_iota_c<32>; using R1 = mp_unique_if_q>; BOOST_TEST_TRAIT_TRUE((std::is_same)); using R2 = mp_unique_if_q; BOOST_TEST_TRAIT_TRUE((std::is_same)); using R3 = mp_unique_if_q; BOOST_TEST_TRAIT_TRUE((std::is_same>>)); } { using boost::mp11::mp_list_c; using boost::mp11::mp_append; using boost::mp11::mp_push_back; using boost::mp11::mp_int; using L1 = mp_list_c; using L2 = mp_list_c; using L3 = mp_list_c; using R1 = mp_unique_if_q, Q1>; BOOST_TEST_TRAIT_TRUE((std::is_same, std::integral_constant>>)); } { BOOST_TEST_TRAIT_TRUE((std::is_same, Q2>, std::tuple>)); BOOST_TEST_TRAIT_TRUE((std::is_same, Q2>, std::tuple>)); } return boost::report_errors(); }