template<class T> constexpr const T& min(const T& a, const T& b);
-?- Preconditions:
-?- Returns:T
meets the Cpp17LessThanComparable requirements (Table 29).b < a ? b : a
. -?- Remarks: An invocation may explicitly specify an argument for the template parameterT
.
template<class T, class Compare> constexpr const T& min(const T& a, const T& b, Compare comp);
-?- Returns:
-?- Remarks: An invocation may explicitly specify an argument for the template parametercomp(b, a) ? b : a
.T
.
template<class T, class Proj = identity, indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> constexpr const T& ranges::min(const T& a, const T& b, Comp comp = {}, Proj proj = {});
-1- Preconditions: For the first form,
-2- Returns:T
meets the Cpp17LessThanComparable requirements (Table 29).comp(proj(b), proj(a)) ? b : a
The smaller value. Returns the first argument when the arguments are equivalent. -3- Complexity: Exactly one comparison and two applications of the projection, if any. -4- Remarks: An invocation may explicitly specify an argument for the template parameterT
of the overloads in namespacestd
.
template<class T> constexpr T min(initializer_list<T> r);
-?- Preconditions:
-?- Returns: The leftmost elementranges::distance(r) > 0
.T
meets the Cpp17CopyConstructible (Table 32) and Cpp17LessThanComparable (Table 29) requirements.x
inr
wherey < x
isfalse
for all subsequent elementsy
. -?- Complexity: Exactlyranges::distance(r) - 1
comparisons. -?- Remarks: An invocation may explicitly specify an argument for the template parameterT
.
template<class T, class Compare> constexpr T min(initializer_list<T> r, Compare comp);
-?- Preconditions:
-?- Returns: The leftmost elementranges::distance(r) > 0
.T
meets the Cpp17CopyConstructible requirements (Table 32).x
inr
wherecomp(y, x)
isfalse
for all subsequent elementsy
. -?- Complexity: Exactlyranges::distance(r) - 1
comparisons. -?- Remarks: An invocation may explicitly specify an argument for the template parameterT
.
template<copyable T, class Proj = identity, indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> constexpr T ranges::min(initializer_list<T> r, Comp comp = {}, Proj proj = {}); template<input_range R, class Proj = identity, indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> constexpr range_value_t<R> ranges::min(R&& r, Comp comp = {}, Proj proj = {});
-5- Preconditions:
-6- Returns: The leftmost elementranges::distance(r) > 0
. For the overloads in namespacestd
,T
meets the Cpp17CopyConstructible requirements. For the first form,T
meets the Cpp17LessThanComparable requirements (Table 29).x
inr
wherecomp(proj(y), proj(x))
isfalse
for all subsequent elementsy
The smallest value in the input range. Returns a copy of the leftmost element when several elements are equivalent to the smallest. -7- Complexity: Exactlyranges::distance(r) - 1
comparisons and twice as many applications of the projection , if any. -8- Remarks: An invocation may explicitly specify an argument for the template parameterT
of the overloads in namespacestd
.
template<class T> constexpr const T& max(const T& a, const T& b);
-?- Preconditions:
-?- Returns:T
meets the Cpp17LessThanComparable requirements (Table 29).a < b ? b : a
. -?- Remarks: An invocation may explicitly specify an argument for the template parameterT
.
template<class T, class Compare> constexpr const T& max(const T& a, const T& b, Compare comp);
-?- Returns:
-?- Remarks: An invocation may explicitly specify an argument for the template parametercomp(a, b) ? b : a
.T
.
template<class T, class Proj = identity, indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> constexpr const T& ranges::max(const T& a, const T& b, Comp comp = {}, Proj proj = {});
-9- Preconditions: For the first form,
-10- Returns:T
meets the Cpp17LessThanComparable requirements (Table 29).comp(proj(a), proj(b)) ? b : a
The larger value. Returns the first argument when the arguments are equivalent. -11- Complexity: Exactly one comparison and two applications of the projection, if any. -12- Remarks: An invocation may explicitly specify an argument for the template parameterT
of the overloads in namespacestd
.
template<class T> constexpr T max(initializer_list<T> r);
-?- Preconditions:
-?- Returns: The leftmost elementranges::distance(r) > 0
.T
meets the Cpp17CopyConstructible (Table 32) and Cpp17LessThanComparable (Table 29) requirements.x
inr
wherex < y
isfalse
for all subsequent elementsy
. -?- Complexity: Exactlyranges::distance(r) - 1
comparisons. -?- Remarks: An invocation may explicitly specify an argument for the template parameterT
.
template<class T, class Compare> constexpr T max(initializer_list<T> r, Compare comp);
-?- Preconditions:
-?- Returns: The leftmost elementranges::distance(r) > 0
.T
meets the Cpp17CopyConstructible requirements (Table 32).x
inr
wherecomp(x, y)
isfalse
for all subsequent elementsy
. -?- Complexity: Exactlyranges::distance(r) - 1
comparisons. -?- Remarks: An invocation may explicitly specify an argument for the template parameterT
.
template<copyable T, class Proj = identity, indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> constexpr T ranges::max(initializer_list<T> r, Comp comp = {}, Proj proj = {}); template<input_range R, class Proj = identity, indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*> constexpr range_value_t<R> ranges::max(R&& r, Comp comp = {}, Proj proj = {});
-13- Preconditions:
-14- Returns: The leftmost elementranges::distance(r) > 0
. For the overloads in namespacestd
,T
meets the Cpp17CopyConstructible requirements. For the first form,T
meets the Cpp17LessThanComparable requirements (Table 29).x
inr
wherecomp(proj(x), proj(y)
isfalse
for all subsequent elementsy
The largest value in the input range. Returns a copy of the leftmost element when several elements are equivalent to the largest. -15- Complexity: Exactlyranges::distance(r) - 1
comparisons and twice as many applications of the projection , if any. -16- Remarks: An invocation may explicitly specify an argument for the template parameterT
of the overloads in namespacestd
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4