diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 4e5bf03..7820756 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -881,30 +882,8 @@ template using mp_erase = mp_append, mp template using mp_erase_c = mp_append, mp_drop_c>; // mp_min_element -namespace detail -{ - -template class P> struct select_min -{ - template using fn = mp_if, T1, T2>; -}; - -} // namespace detail - -template class P> using mp_min_element = mp_fold_q, mp_first, detail::select_min

>; - // mp_max_element -namespace detail -{ - -template class P> struct select_max -{ - template using fn = mp_if, T1, T2>; -}; - -} // namespace detail - -template class P> using mp_max_element = mp_fold_q, mp_first, detail::select_max

>; +// in detail/mp_min_element.hpp } // namespace mp11 } // namespace boost diff --git a/include/boost/mp11/detail/mp_fold.hpp b/include/boost/mp11/detail/mp_fold.hpp index 62bc785..ae6f974 100644 --- a/include/boost/mp11/detail/mp_fold.hpp +++ b/include/boost/mp11/detail/mp_fold.hpp @@ -8,10 +8,8 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include -#include -#include #include +#include namespace boost { diff --git a/include/boost/mp11/detail/mp_min_element.hpp b/include/boost/mp11/detail/mp_min_element.hpp new file mode 100644 index 0000000..3b4f274 --- /dev/null +++ b/include/boost/mp11/detail/mp_min_element.hpp @@ -0,0 +1,49 @@ +#ifndef BOOST_MP11_DETAIL_MP_MIN_ELEMENT_HPP_INCLUDED +#define BOOST_MP11_DETAIL_MP_MIN_ELEMENT_HPP_INCLUDED + +// Copyright 2015-2017 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 + +namespace boost +{ +namespace mp11 +{ + +// mp_min_element +namespace detail +{ + +template class P> struct select_min +{ + template using fn = mp_if, T1, T2>; +}; + +} // namespace detail + +template class P> using mp_min_element = mp_fold_q, mp_first, detail::select_min

>; + +// mp_max_element +namespace detail +{ + +template class P> struct select_max +{ + template using fn = mp_if, T1, T2>; +}; + +} // namespace detail + +template class P> using mp_max_element = mp_fold_q, mp_first, detail::select_max

>; + +} // namespace mp11 +} // namespace boost + +#endif // #ifndef BOOST_MP11_DETAIL_MP_MIN_ELEMENT_HPP_INCLUDED