Min and Max
You can determine the minimum, the maximum and the minimum and maximum pair of a range with the algorithms std::min_element
, std::max_element
and std::minmax_element
. Each algorithm can be configured with a binary predicate.
Returns the minimum element of the range:
constexpr
FwdIt
min_element
(
FwdIt
first
,
FwdIt
last
)
FwdIt
min_element
(
ExePol
pol
,
FwdIt
first
,
FwdIt
last
)
constexpr
FwdIt
min_element
(
FwdIt
first
,
FwdIt
last
,
BinPre
pre
)
FwdIt
min_element
(
ExePol
pol
,
FwdIt
first
,
FwdIt
last
,
BinPre
pre
)
Returns the maximum element of the range:
constexpr
FwdIt
max_element
(
FwdIt
first
,
FwdIt
last
)
FwdIt
max_element
(
ExePol
pol
,
FwdIt
first
,
FwdIt
last
)
constexpr
FwdIt
max_element
(
FwdIt
first
,
FwdIt
last
,
BinPre
pre
)
FwdIt
max_element
(
ExePol
pol
,
FwdIt
first
,
FwdIt
last
,
BinPre
pre
)
Returns the pair std::min_element
and std::max_element
of the range:
constexpr
pair
<
FwdIt
,
FwdIt
>
minmax_element
(
FwdIt
first
,
FwdIt
last
)
pair
<
FwdIt
,
FwdIt
>
minmax_element...