4#ifndef TETL_ALGORITHM_MINMAX_HPP
5#define TETL_ALGORITHM_MINMAX_HPP
7#include <etl/_functional/less.hpp>
8#include <etl/_utility/pair.hpp>
14template <
typename T,
typename Compare>
15[[nodiscard]]
constexpr auto minmax(T
const& a, T
const& b, Compare comp) ->
pair<T
const&, T
const&>
17 using return_type =
pair<T
const&, T
const&>;
18 return comp(b, a) ? return_type(b, a) : return_type(a, b);
24[[nodiscard]]
constexpr auto minmax(T
const& a, T
const& b) ->
pair<T
const&, T
const&>
constexpr auto minmax(T const &a, T const &b, Compare comp) -> pair< T const &, T const & >
Returns the lowest and the greatest of the given values.
Definition minmax.hpp:15
constexpr auto minmax(T const &a, T const &b) -> pair< T const &, T const & >
Returns the lowest and the greatest of the given values.
Definition minmax.hpp:24
Definition adjacent_find.hpp:9
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:15
etl::pair is a class template that provides a way to store two heterogeneous objects as a single unit...
Definition pair.hpp:37