mirror of
https://github.com/boostorg/mp11.git
synced 2026-05-05 20:24:21 +02:00
Add mp_all_of, mp_any_of, mp_none_of.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#include <boost/mp11/set.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <boost/mp11/detail/mp_plus.hpp>
|
||||
#include <boost/mp11/function.hpp>
|
||||
#include <boost/mp11/detail/mp_map_find.hpp>
|
||||
#include <boost/mp11/detail/config.hpp>
|
||||
#include <boost/integer_sequence.hpp>
|
||||
@@ -796,8 +796,13 @@ template<template<class...> class L, class... T> struct mp_unique_impl<L<T...>>
|
||||
template<class L> using mp_unique = typename detail::mp_unique_impl<L>::type;
|
||||
|
||||
// mp_all_of<L, P>
|
||||
template<class L, template<class...> class P> using mp_all_of = mp_equal_to< mp_count_if<L, P>, mp_size<L> >;
|
||||
|
||||
// mp_none_of<L, P>
|
||||
template<class L, template<class...> class P> using mp_none_of = mp_not< mp_count_if<L, P> >;
|
||||
|
||||
// mp_any_of<L, P>
|
||||
template<class L, template<class...> class P> using mp_any_of = mp_to_bool< mp_count_if<L, P> >;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -8,11 +8,18 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/detail/mp_plus.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// mp_plus<T...>
|
||||
// mp_not<T>
|
||||
template<class T> using mp_not = mp_bool< !T::value >;
|
||||
|
||||
// mp_equal_to<T1, T2>
|
||||
template<class T1, class T2> using mp_equal_to = mp_bool< T1::value == T2::value >;
|
||||
|
||||
// mp_all<T...>
|
||||
// mp_and<T...>
|
||||
// mp_any<T...>
|
||||
|
||||
Reference in New Issue
Block a user