mirror of
https://github.com/boostorg/mp11.git
synced 2025-12-06 00:29:19 +01:00
Change mp_and and mp_or to match std::conjuction and std::disjunction
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef BOOST_MP11_FUNCTION_HPP_INCLUDED
|
||||
#define BOOST_MP11_FUNCTION_HPP_INCLUDED
|
||||
|
||||
// Copyright 2015, 2016 Peter Dimov.
|
||||
// Copyright 2015-2017 Peter Dimov.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
//
|
||||
@@ -39,9 +39,14 @@ template<> struct mp_and_impl<>
|
||||
using type = mp_true;
|
||||
};
|
||||
|
||||
template<class T> struct mp_and_impl<T>
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<class T1, class... T> struct mp_and_impl<T1, T...>
|
||||
{
|
||||
using type = mp_eval_if< mp_not<T1>, mp_false, mp_and, T... >;
|
||||
using type = mp_eval_if< mp_not<T1>, T1, mp_and, T... >;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@@ -67,9 +72,14 @@ template<> struct mp_or_impl<>
|
||||
using type = mp_false;
|
||||
};
|
||||
|
||||
template<class T> struct mp_or_impl<T>
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<class T1, class... T> struct mp_or_impl<T1, T...>
|
||||
{
|
||||
using type = mp_eval_if< T1, mp_true, mp_or, T... >;
|
||||
using type = mp_eval_if< T1, T1, mp_or, T... >;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
Reference in New Issue
Block a user