From Jason Turner

[linalg.helpers.abs]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5dj_1lz0/{from.md → to.md} +18 -0
tmp/tmp5dj_1lz0/{from.md → to.md} RENAMED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### *`abs-if-needed`* <a id="linalg.helpers.abs">[[linalg.helpers.abs]]</a>
2
+
3
+ The name *`abs-if-needed`* denotes an exposition-only function object.
4
+ The expression `abs-if-needed(E)` for a subexpression `E` whose type is
5
+ `T` is expression-equivalent to:
6
+
7
+ - `E` if `T` is an unsigned integer;
8
+ - otherwise, `std::abs(E)` if `T` is an arithmetic type,
9
+ - otherwise, `abs(E)`, if that expression is valid, with overload
10
+ resolution performed in a context that includes the declaration
11
+ ``` cpp
12
+ template<class U> U abs(U) = delete;
13
+ ```
14
+
15
+ If the function selected by overload resolution does not return the
16
+ absolute value of its input, the program is ill-formed, no diagnostic
17
+ required.
18
+