A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue2239 below:

Issue 2239: min/max/minmax requirements

template<class T> constexpr const T& min(const T& a, const T& b);
template<class T, class Compare>
  constexpr const T& min(const T& a, const T& b, Compare comp);

-1- Requires: For the first form, type T shall be Type T isLessThanComparable (Table 18).

-2- Returns: The smaller value. -3- Remarks: Returns the first argument when the arguments are equivalent. -?- Complexity: Exactly one comparison.
template<class T>
  constexpr T min(initializer_list<T> t);
template<class T, class Compare>
  constexpr T min(initializer_list<T> t, Compare comp);

-4- Requires: T is LessThanComparable and shall beCopyConstructible and t.size() > 0. For the first form, type T shall be LessThanComparable.

-5- Returns: […] -6- Remarks: […] -?- Complexity: Exactly t.size() - 1 comparisons.
template<class T> constexpr const T& max(const T& a, const T& b);
template<class T, class Compare>
  constexpr const T& max(const T& a, const T& b, Compare comp);

-7- Requires: For the first form, type T shall be Type T isLessThanComparable (Table 18).

-8- Returns: […] -9- Remarks: […] -?- Complexity: Exactly one comparison.
template<class T>
  constexpr T max(initializer_list<T> t);
template<class T, class Compare>
  constexpr T max(initializer_list<T> t, Compare comp);

-10- Requires: T is LessThanComparable and shall beCopyConstructible and t.size() > 0. For the first form, type T shall be LessThanComparable.

-11- Returns: […] -12- Remarks: […] -?- Complexity: Exactly t.size() - 1 comparisons.
template<class T> constexpr pair<const T&, const T&> minmax(const T& a, const T& b);
template<class T, class Compare>
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);

-13- Requires: For the first form, t Type T shall be LessThanComparable (Table 18).

-14- Returns: […] -15- Remarks: […] -16- Complexity: Exactly one comparison.
template<class T>
  constexpr pair<T, T> minmax(initializer_list<T> t);
template<class T, class Compare>
  constexpr pair<T, T> minmax(initializer_list<T> t, Compare comp);

-17- Requires: T is LessThanComparable and shall beCopyConstructible and t.size() > 0. For the first form, type T shall be LessThanComparable.

-18- Returns: […] -19- Remarks: […] -20- Complexity: At most (3/2) * t.size() applications of the corresponding predicate.

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