From 7a0f4001e7cae0d01f268d5af966c51f50e9d19f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 16 Nov 2016 21:24:13 +0200 Subject: [PATCH] Add mp_all, mp_and, mp_any, mp_or; move mp_not to integral.hpp. --- include/boost/mp11/algorithm.hpp | 74 +-------------------- include/boost/mp11/detail/mp_count.hpp | 92 ++++++++++++++++++++++++++ include/boost/mp11/detail/mp_list.hpp | 21 ++++++ include/boost/mp11/function.hpp | 60 +++++++++++++++-- include/boost/mp11/integral.hpp | 3 + include/boost/mp11/list.hpp | 6 +- test/Jamfile.v2 | 6 ++ test/integral.cpp | 15 +++++ test/mp_all.cpp | 57 ++++++++++++++++ test/mp_and.cpp | 64 ++++++++++++++++++ test/mp_any.cpp | 62 +++++++++++++++++ test/mp_or.cpp | 73 ++++++++++++++++++++ 12 files changed, 451 insertions(+), 82 deletions(-) create mode 100644 include/boost/mp11/detail/mp_count.hpp create mode 100644 include/boost/mp11/detail/mp_list.hpp create mode 100644 test/mp_all.cpp create mode 100644 test/mp_and.cpp create mode 100644 test/mp_any.cpp create mode 100644 test/mp_or.cpp diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 3a1e6af..126d359 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -1,7 +1,7 @@ #ifndef BOOST_MP11_ALGORITHM_HPP_INCLUDED #define BOOST_MP11_ALGORITHM_HPP_INCLUDED -// Copyright 2015 Peter Dimov. +// Copyright 2015, 2016 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -95,77 +96,6 @@ template class L, class... T, class V> struct mp_fill_impl using mp_fill = typename detail::mp_fill_impl::type; -// mp_count -namespace detail -{ - -template struct mp_count_impl; - -#if !defined( BOOST_MP11_NO_CONSTEXPR ) - -constexpr std::size_t cx_plus() -{ - return 0; -} - -template constexpr std::size_t cx_plus(T1 t1, T... t) -{ - return t1 + cx_plus(t...); -} - -template class L, class... T, class V> struct mp_count_impl, V> -{ - using type = mp_size_t::value...)>; -}; - -#else - -template class L, class... T, class V> struct mp_count_impl, V> -{ - using type = mp_size_t...>::value>; -}; - -#endif - -} // namespace detail - -template using mp_count = typename detail::mp_count_impl::type; - -// mp_count_if -namespace detail -{ - -template class P> struct mp_count_if_impl; - -#if !defined( BOOST_MP11_NO_CONSTEXPR ) - -template class L, class... T, template class P> struct mp_count_if_impl, P> -{ - using type = mp_size_t>::value...)>; -}; - -#else - -template class L, class... T, template class P> struct mp_count_if_impl, P> -{ -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1900 ) - - template struct _f { using type = mp_to_bool>; }; - using type = mp_size_t::type...>::value>; - -#else - - using type = mp_size_t>...>::value>; - -#endif -}; - -#endif - -} // namespace detail - -template class P> using mp_count_if = typename detail::mp_count_if_impl::type; - // mp_contains template using mp_contains = mp_to_bool>; diff --git a/include/boost/mp11/detail/mp_count.hpp b/include/boost/mp11/detail/mp_count.hpp new file mode 100644 index 0000000..8a6ada5 --- /dev/null +++ b/include/boost/mp11/detail/mp_count.hpp @@ -0,0 +1,92 @@ +#ifndef BOOST_MP11_DETAIL_MP_COUNT_HPP_INCLUDED +#define BOOST_MP11_DETAIL_MP_COUNT_HPP_INCLUDED + +// Copyright 2015, 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 +#include +#include + +namespace boost +{ + +// mp_count +namespace detail +{ + +template struct mp_count_impl; + +#if !defined( BOOST_MP11_NO_CONSTEXPR ) + +constexpr std::size_t cx_plus() +{ + return 0; +} + +template constexpr std::size_t cx_plus(T1 t1, T... t) +{ + return t1 + cx_plus(t...); +} + +template class L, class... T, class V> struct mp_count_impl, V> +{ + using type = mp_size_t::value...)>; +}; + +#else + +template class L, class... T, class V> struct mp_count_impl, V> +{ + using type = mp_size_t...>::value>; +}; + +#endif + +} // namespace detail + +template using mp_count = typename detail::mp_count_impl::type; + +// mp_count_if +namespace detail +{ + +template class P> struct mp_count_if_impl; + +#if !defined( BOOST_MP11_NO_CONSTEXPR ) + +template class L, class... T, template class P> struct mp_count_if_impl, P> +{ + using type = mp_size_t>::value...)>; +}; + +#else + +template class L, class... T, template class P> struct mp_count_if_impl, P> +{ +#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1900 ) + + template struct _f { using type = mp_to_bool>; }; + using type = mp_size_t::type...>::value>; + +#else + + using type = mp_size_t>...>::value>; + +#endif +}; + +#endif + +} // namespace detail + +template class P> using mp_count_if = typename detail::mp_count_if_impl::type; + +} // namespace boost + +#endif // #ifndef BOOST_MP11_DETAIL_MP_COUNT_HPP_INCLUDED diff --git a/include/boost/mp11/detail/mp_list.hpp b/include/boost/mp11/detail/mp_list.hpp new file mode 100644 index 0000000..e0e285a --- /dev/null +++ b/include/boost/mp11/detail/mp_list.hpp @@ -0,0 +1,21 @@ +#ifndef BOOST_MP11_DETAIL_MP_LIST_HPP_INCLUDED +#define BOOST_MP11_DETAIL_MP_LIST_HPP_INCLUDED + +// Copyright 2015, 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 + +namespace boost +{ + +// mp_list +template struct mp_list +{ +}; + +} // namespace boost + +#endif // #ifndef BOOST_MP11_DETAIL_MP_LIST_HPP_INCLUDED diff --git a/include/boost/mp11/function.hpp b/include/boost/mp11/function.hpp index c78fe29..cefec1a 100644 --- a/include/boost/mp11/function.hpp +++ b/include/boost/mp11/function.hpp @@ -1,7 +1,7 @@ #ifndef BOOST_MP11_FUNCTION_HPP_INCLUDED #define BOOST_MP11_FUNCTION_HPP_INCLUDED -// Copyright 2015 Peter Dimov. +// Copyright 2015, 2016 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -9,21 +9,71 @@ // http://www.boost.org/LICENSE_1_0.txt #include -#include +#include +#include +#include namespace boost { -// mp_not -template using mp_not = mp_bool< !T::value >; - // mp_equal_to template using mp_equal_to = mp_bool< T1::value == T2::value >; // mp_all +template using mp_all = mp_bool< mp_count_if< mp_list, mp_to_bool >::value == sizeof...(T) >; + // mp_and +namespace detail +{ + +template struct mp_and_impl; + +} // namespace detail + +template using mp_and = typename detail::mp_and_impl::type; + +namespace detail +{ + +template<> struct mp_and_impl<> +{ + using type = mp_true; +}; + +template struct mp_and_impl +{ + using type = mp_eval_if< mp_not, mp_false, mp_and, T... >; +}; + +} // namespace detail + // mp_any +template using mp_any = mp_bool< mp_count_if< mp_list, mp_to_bool >::value != 0 >; + // mp_or +namespace detail +{ + +template struct mp_or_impl; + +} // namespace detail + +template using mp_or = typename detail::mp_or_impl::type; + +namespace detail +{ + +template<> struct mp_or_impl<> +{ + using type = mp_false; +}; + +template struct mp_or_impl +{ + using type = mp_eval_if< T1, mp_true, mp_or, T... >; +}; + +} // namespace detail } // namespace boost diff --git a/include/boost/mp11/integral.hpp b/include/boost/mp11/integral.hpp index 7380f5a..ebe52b5 100644 --- a/include/boost/mp11/integral.hpp +++ b/include/boost/mp11/integral.hpp @@ -23,6 +23,9 @@ using mp_false = mp_bool; // mp_to_bool template using mp_to_bool = mp_bool( T::value )>; +// mp_not +template using mp_not = mp_bool< !T::value >; + // mp_int template using mp_int = std::integral_constant; diff --git a/include/boost/mp11/list.hpp b/include/boost/mp11/list.hpp index ecc672e..6f09d25 100644 --- a/include/boost/mp11/list.hpp +++ b/include/boost/mp11/list.hpp @@ -9,15 +9,11 @@ // http://www.boost.org/LICENSE_1_0.txt #include +#include namespace boost { -// mp_list -template struct mp_list -{ -}; - // mp_size namespace detail { diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 1457fdf..dd1c838 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -82,3 +82,9 @@ run tuple_for_each_cx.cpp : : : $(REQ) ; run mp_set_contains.cpp : : : $(REQ) ; run mp_set_push_back.cpp : : : $(REQ) ; run mp_set_push_front.cpp : : : $(REQ) ; + +# function +run mp_all.cpp : : : $(REQ) ; +run mp_and.cpp : : : $(REQ) ; +run mp_any.cpp : : : $(REQ) ; +run mp_or.cpp : : : $(REQ) ; diff --git a/test/integral.cpp b/test/integral.cpp index 6935aad..82002b5 100644 --- a/test/integral.cpp +++ b/test/integral.cpp @@ -51,5 +51,20 @@ int main() BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + using boost::mp_not; + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + return boost::report_errors(); } diff --git a/test/mp_all.cpp b/test/mp_all.cpp new file mode 100644 index 0000000..651c208 --- /dev/null +++ b/test/mp_all.cpp @@ -0,0 +1,57 @@ + +// Copyright 2015, 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 +#include +#include + +int main() +{ + using boost::mp_all; + using boost::mp_true; + using boost::mp_false; + using boost::mp_int; + using boost::mp_size_t; + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<7>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<1>>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<2>, mp_int<-11>, mp_int<14>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_int<-11>, mp_int<14>>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<2>, mp_size_t<114>, mp_size_t<8>, mp_size_t<94>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<2>, mp_size_t<114>, mp_size_t<0>, mp_size_t<94>>, mp_false>)); + + return boost::report_errors(); +} diff --git a/test/mp_and.cpp b/test/mp_and.cpp new file mode 100644 index 0000000..d75552f --- /dev/null +++ b/test/mp_and.cpp @@ -0,0 +1,64 @@ + +// Copyright 2015, 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 +#include +#include + +int main() +{ + using boost::mp_and; + using boost::mp_true; + using boost::mp_false; + using boost::mp_int; + using boost::mp_size_t; + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<5>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, void>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<8>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, void>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<2>, mp_int<-11>, mp_int<14>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, void, void>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<2>, mp_size_t<114>, mp_size_t<8>, mp_size_t<94>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<2>, mp_size_t<0>, void, void>, mp_false>)); + + return boost::report_errors(); +} diff --git a/test/mp_any.cpp b/test/mp_any.cpp new file mode 100644 index 0000000..f7e45c9 --- /dev/null +++ b/test/mp_any.cpp @@ -0,0 +1,62 @@ + +// Copyright 2015, 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 +#include +#include + +int main() +{ + using boost::mp_any; + using boost::mp_true; + using boost::mp_false; + using boost::mp_int; + using boost::mp_size_t; + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<7>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<1>>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<2>, mp_int<-11>, mp_int<14>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_int<-11>, mp_int<0>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_int<0>, mp_int<0>>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<2>, mp_size_t<114>, mp_size_t<8>, mp_size_t<94>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>, mp_size_t<114>, mp_size_t<0>, mp_size_t<0>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>, mp_size_t<0>, mp_size_t<0>, mp_size_t<0>>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_false, mp_size_t<141>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_false>, mp_false>)); + + return boost::report_errors(); +} diff --git a/test/mp_or.cpp b/test/mp_or.cpp new file mode 100644 index 0000000..3e4c842 --- /dev/null +++ b/test/mp_or.cpp @@ -0,0 +1,73 @@ + +// Copyright 2015, 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 +#include +#include + +int main() +{ + using boost::mp_or; + using boost::mp_true; + using boost::mp_false; + using boost::mp_int; + using boost::mp_size_t; + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>>, mp_false>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<5>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, void>, mp_true>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<4>>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<2>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_int<3>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_int<0>, mp_int<4>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_int<0>, mp_int<0>, mp_int<0>>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<2>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>, mp_size_t<3>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>, mp_size_t<0>, mp_size_t<4>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_size_t<0>, mp_size_t<0>, mp_size_t<0>, mp_size_t<0>>, mp_false>)); + + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_false, mp_size_t<141>, void, void, void>, mp_true>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, mp_int<0>, mp_false>, mp_false>)); + + return boost::report_errors(); +}