From Jason Turner

[alg.clamp]

Diff to HTML by rtfpessoa

tmp/tmp3sl6ql1q/{from.md → to.md} RENAMED
@@ -12,16 +12,19 @@ template<class T, class Proj = identity,
12
  ```
13
 
14
  Let `comp` be `less{}` for the overloads with no parameter `comp`, and
15
  let `proj` be `identity{}` for the overloads with no parameter `proj`.
16
 
17
- *Preconditions:* `bool(comp(proj(hi), proj(lo)))` is `false`. For the
18
- first form, type `T` meets the *Cpp17LessThanComparable* requirements
19
- ([[cpp17.lessthancomparable]]).
 
20
 
21
- *Returns:* `lo` if `bool(comp(proj(v), proj(lo)))` is `true`, `hi` if
22
- `bool(comp(proj(hi), proj(v)))` is `true`, otherwise `v`.
 
 
23
 
24
  [*Note 1*: If NaN is avoided, `T` can be a floating-point
25
  type. — *end note*]
26
 
27
  *Complexity:* At most two comparisons and three applications of the
 
12
  ```
13
 
14
  Let `comp` be `less{}` for the overloads with no parameter `comp`, and
15
  let `proj` be `identity{}` for the overloads with no parameter `proj`.
16
 
17
+ *Preconditions:*
18
+ `bool(invoke(comp, invoke(proj, hi), invoke(proj, lo)))` is `false`. For
19
+ the first form, type `T` meets the *Cpp17LessThanComparable*
20
+ requirements ([[cpp17.lessthancomparable]]).
21
 
22
+ *Returns:* `lo` if
23
+ `bool(invoke(comp, invoke(proj, v), invoke(proj, lo)))` is `true`, `hi`
24
+ if `bool(invoke(comp, invoke(proj, hi), invoke(proj, v)))` is `true`,
25
+ otherwise `v`.
26
 
27
  [*Note 1*: If NaN is avoided, `T` can be a floating-point
28
  type. — *end note*]
29
 
30
  *Complexity:* At most two comparisons and three applications of the