From Jason Turner

[valarray.binary]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbr2b5sxc/{from.md → to.md} +59 -50
tmp/tmpbr2b5sxc/{from.md → to.md} RENAMED
@@ -1,68 +1,77 @@
1
- #### `valarray` binary operators <a id="valarray.binary">[[valarray.binary]]</a>
2
 
3
  ``` cpp
4
- template<class T> valarray<T> operator*
5
- (const valarray<T>&, const valarray<T>&);
6
- template<class T> valarray<T> operator/
7
- (const valarray<T>&, const valarray<T>&);
8
- template<class T> valarray<T> operator%
9
- (const valarray<T>&, const valarray<T>&);
10
- template<class T> valarray<T> operator+
11
- (const valarray<T>&, const valarray<T>&);
12
- template<class T> valarray<T> operator-
13
- (const valarray<T>&, const valarray<T>&);
14
- template<class T> valarray<T> operator^
15
- (const valarray<T>&, const valarray<T>&);
16
- template<class T> valarray<T> operator&
17
- (const valarray<T>&, const valarray<T>&);
18
- template<class T> valarray<T> operator|
19
- (const valarray<T>&, const valarray<T>&);
20
- template<class T> valarray<T> operator<<
21
- (const valarray<T>&, const valarray<T>&);
22
- template<class T> valarray<T> operator>>
23
- (const valarray<T>&, const valarray<T>&);
24
  ```
25
 
26
- *Requires:* Each of these operators may only be instantiated for a type
27
- `T` to which the indicated operator can be applied and for which the
28
- indicated operator returns a value which is of type `T` or which can be
29
- unambiguously implicitly converted to type `T`. The argument arrays have
30
- the same length.
31
 
32
  *Returns:* A `valarray` whose length is equal to the lengths of the
33
  argument arrays. Each element of the returned array is initialized with
34
  the result of applying the indicated operator to the corresponding
35
  elements of the argument arrays.
36
 
37
  ``` cpp
38
- template<class T> valarray<T> operator* (const valarray<T>&, const T&);
39
- template<class T> valarray<T> operator* (const T&, const valarray<T>&);
40
- template<class T> valarray<T> operator/ (const valarray<T>&, const T&);
41
- template<class T> valarray<T> operator/ (const T&, const valarray<T>&);
42
- template<class T> valarray<T> operator% (const valarray<T>&, const T&);
43
- template<class T> valarray<T> operator% (const T&, const valarray<T>&);
44
- template<class T> valarray<T> operator+ (const valarray<T>&, const T&);
45
- template<class T> valarray<T> operator+ (const T&, const valarray<T>&);
46
- template<class T> valarray<T> operator- (const valarray<T>&, const T&);
47
- template<class T> valarray<T> operator- (const T&, const valarray<T>&);
48
- template<class T> valarray<T> operator^ (const valarray<T>&, const T&);
49
- template<class T> valarray<T> operator^ (const T&, const valarray<T>&);
50
- template<class T> valarray<T> operator& (const valarray<T>&, const T&);
51
- template<class T> valarray<T> operator& (const T&, const valarray<T>&);
52
- template<class T> valarray<T> operator| (const valarray<T>&, const T&);
53
- template<class T> valarray<T> operator| (const T&, const valarray<T>&);
54
- template<class T> valarray<T> operator<<(const valarray<T>&, const T&);
55
- template<class T> valarray<T> operator<<(const T&, const valarray<T>&);
56
- template<class T> valarray<T> operator>>(const valarray<T>&, const T&);
57
- template<class T> valarray<T> operator>>(const T&, const valarray<T>&);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  ```
59
 
60
- *Requires:* Each of these operators may only be instantiated for a type
61
- `T` to which the indicated operator can be applied and for which the
62
- indicated operator returns a value which is of type `T` or which can be
63
- unambiguously implicitly converted to type `T`.
64
 
65
  *Returns:* A `valarray` whose length is equal to the length of the array
66
  argument. Each element of the returned array is initialized with the
67
  result of applying the indicated operator to the corresponding element
68
  of the array argument and the non-array argument.
 
1
+ #### Binary operators <a id="valarray.binary">[[valarray.binary]]</a>
2
 
3
  ``` cpp
4
+ template<class T> valarray<T> operator* (const valarray<T>&, const valarray<T>&);
5
+ template<class T> valarray<T> operator/ (const valarray<T>&, const valarray<T>&);
6
+ template<class T> valarray<T> operator% (const valarray<T>&, const valarray<T>&);
7
+ template<class T> valarray<T> operator+ (const valarray<T>&, const valarray<T>&);
8
+ template<class T> valarray<T> operator- (const valarray<T>&, const valarray<T>&);
9
+ template<class T> valarray<T> operator^ (const valarray<T>&, const valarray<T>&);
10
+ template<class T> valarray<T> operator& (const valarray<T>&, const valarray<T>&);
11
+ template<class T> valarray<T> operator| (const valarray<T>&, const valarray<T>&);
12
+ template<class T> valarray<T> operator<<(const valarray<T>&, const valarray<T>&);
13
+ template<class T> valarray<T> operator>>(const valarray<T>&, const valarray<T>&);
 
 
 
 
 
 
 
 
 
 
14
  ```
15
 
16
+ *Mandates:* The indicated operator can be applied to operands of type
17
+ `T` and returns a value of type `T` or which can be unambiguously
18
+ implicitly converted to `T`.
19
+
20
+ *Preconditions:* The argument arrays have the same length.
21
 
22
  *Returns:* A `valarray` whose length is equal to the lengths of the
23
  argument arrays. Each element of the returned array is initialized with
24
  the result of applying the indicated operator to the corresponding
25
  elements of the argument arrays.
26
 
27
  ``` cpp
28
+ template<class T> valarray<T> operator* (const valarray<T>&,
29
+ const typename valarray<T>::value_type&);
30
+ template<class T> valarray<T> operator* (const typename valarray<T>::value_type&,
31
+ const valarray<T>&);
32
+ template<class T> valarray<T> operator/ (const valarray<T>&,
33
+ const typename valarray<T>::value_type&);
34
+ template<class T> valarray<T> operator/ (const typename valarray<T>::value_type&,
35
+ const valarray<T>&);
36
+ template<class T> valarray<T> operator% (const valarray<T>&,
37
+ const typename valarray<T>::value_type&);
38
+ template<class T> valarray<T> operator% (const typename valarray<T>::value_type&,
39
+ const valarray<T>&);
40
+ template<class T> valarray<T> operator+ (const valarray<T>&,
41
+ const typename valarray<T>::value_type&);
42
+ template<class T> valarray<T> operator+ (const typename valarray<T>::value_type&,
43
+ const valarray<T>&);
44
+ template<class T> valarray<T> operator- (const valarray<T>&,
45
+ const typename valarray<T>::value_type&);
46
+ template<class T> valarray<T> operator- (const typename valarray<T>::value_type&,
47
+ const valarray<T>&);
48
+ template<class T> valarray<T> operator^ (const valarray<T>&,
49
+ const typename valarray<T>::value_type&);
50
+ template<class T> valarray<T> operator^ (const typename valarray<T>::value_type&,
51
+ const valarray<T>&);
52
+ template<class T> valarray<T> operator& (const valarray<T>&,
53
+ const typename valarray<T>::value_type&);
54
+ template<class T> valarray<T> operator& (const typename valarray<T>::value_type&,
55
+ const valarray<T>&);
56
+ template<class T> valarray<T> operator| (const valarray<T>&,
57
+ const typename valarray<T>::value_type&);
58
+ template<class T> valarray<T> operator| (const typename valarray<T>::value_type&,
59
+ const valarray<T>&);
60
+ template<class T> valarray<T> operator<<(const valarray<T>&,
61
+ const typename valarray<T>::value_type&);
62
+ template<class T> valarray<T> operator<<(const typename valarray<T>::value_type&,
63
+ const valarray<T>&);
64
+ template<class T> valarray<T> operator>>(const valarray<T>&,
65
+ const typename valarray<T>::value_type&);
66
+ template<class T> valarray<T> operator>>(const typename valarray<T>::value_type&,
67
+ const valarray<T>&);
68
  ```
69
 
70
+ *Mandates:* The indicated operator can be applied to operands of type
71
+ `T` and returns a value of type `T` or which can be unambiguously
72
+ implicitly converted to `T`.
 
73
 
74
  *Returns:* A `valarray` whose length is equal to the length of the array
75
  argument. Each element of the returned array is initialized with the
76
  result of applying the indicated operator to the corresponding element
77
  of the array argument and the non-array argument.