|
inlineconstexpr |
#include <eve/module/algo/algo/max_element.hpp>
eve::algo::max_value
.By default unrolls by 4 and aligned all memory accesses.
std::max_element* returns first but this is more correct and this is also what !
std::minmax_elementwill return as max. ! ! @note we assume that
eve::is_lessdefined for your type is total order. ! (this comes up when switching min with max) ! ! **Alternative Header** ! ! @code //! #include <eve/algo.hpp> //! @endcode ! ! @groupheader{Callable Signatures} ! @code //! namespace eve::algo //! { //! template<relaxed_range Rng, typename Less> //! auto max_element(Rng&& rng, Less less) -> unaligned_iterator_t<Rng>; // 1 //! //! template<relaxed_range Rng> //! auto max_element(Rng&& rng) -> unaligned_iterator_t<Rng>; // 2 //! } //! @endcode ! ! 1. Returns the position of a maximum value, according to less. ! If the range is empty - returns past the end. ! ! 2. Same as 1 but the less is
eve::is_less ! ! **Parameters** ! ! *
rng: Relaxed input range to process ! *
less: SIMD strict weak ordering. ! ! **Return value** ! ! iterator to max element (end if the range is empty). ! ! @groupheader{Example} ! ! @godbolt{doc/algo/max.cpp} ! ! @see
max_value ! @see
min_element`