/// \file // Range v3 library // // Copyright Eric Niebler 2014-present // Copyright Casey Carter 2016 // // Use, modification and distribution is subject to 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) // // Project home: https://github.com/ericniebler/range-v3 // #ifndef RANGES_V3_ALGORITHM_LOWER_BOUND_HPP #define RANGES_V3_ALGORITHM_LOWER_BOUND_HPP #include #include #include #include #include #include #include #include #include #include #include #include namespace ranges { /// \addtogroup group-algorithms /// @{ RANGES_BEGIN_NIEBLOID(lower_bound) /// \brief function template \c lower_bound template auto RANGES_FUN_NIEBLOID(lower_bound)( I first, S last, V const & val, C pred = C{}, P proj = P{}) ->CPP_ret(I)( // requires forward_iterator && sentinel_for && indirect_strict_weak_order>) { return partition_point(std::move(first), std::move(last), detail::make_lower_bound_predicate(pred, val), std::move(proj)); } /// \overload template auto RANGES_FUN_NIEBLOID(lower_bound)( Rng && rng, V const & val, C pred = C{}, P proj = P{}) ->CPP_ret(safe_iterator_t)( // requires forward_range && indirect_strict_weak_order, P>>) { return partition_point( rng, detail::make_lower_bound_predicate(pred, val), std::move(proj)); } RANGES_END_NIEBLOID(lower_bound) namespace cpp20 { using ranges::lower_bound; } /// @} } // namespace ranges #endif // include guard