From Jason Turner

[support.types.byteops]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpie86dhdq/{from.md → to.md} +27 -36
tmp/tmpie86dhdq/{from.md → to.md} RENAMED
@@ -3,120 +3,111 @@
3
  ``` cpp
4
  template<class IntType>
5
  constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
6
  ```
7
 
8
- *Remarks:* This function shall not participate in overload resolution
9
- unless `is_integral_v<IntType>` is `true`.
10
 
11
- *Effects:* Equivalent to:
12
- `return b = byte(static_cast<unsigned char>(b) << shift);`
13
 
14
  ``` cpp
15
  template<class IntType>
16
  constexpr byte operator<<(byte b, IntType shift) noexcept;
17
  ```
18
 
19
- *Remarks:* This function shall not participate in overload resolution
20
- unless `is_integral_v<IntType>` is `true`.
21
 
22
  *Effects:* Equivalent to:
23
- `return byte(static_cast<unsigned char>(b) << shift);`
 
 
 
24
 
25
  ``` cpp
26
  template<class IntType>
27
  constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
28
  ```
29
 
30
- *Remarks:* This function shall not participate in overload resolution
31
- unless `is_integral_v<IntType>` is `true`.
32
 
33
- *Effects:* Equivalent to:
34
- `return b = byte(static_cast<unsigned char>(b) >> shift);`
35
 
36
  ``` cpp
37
  template<class IntType>
38
  constexpr byte operator>>(byte b, IntType shift) noexcept;
39
  ```
40
 
41
- *Remarks:* This function shall not participate in overload resolution
42
- unless `is_integral_v<IntType>` is `true`.
43
 
44
  *Effects:* Equivalent to:
45
- `return byte(static_cast<unsigned char>(b) >> shift);`
 
 
 
46
 
47
  ``` cpp
48
  constexpr byte& operator|=(byte& l, byte r) noexcept;
49
  ```
50
 
51
- *Effects:* Equivalent to:
52
-
53
- ``` cpp
54
- return l = byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r));
55
- ```
56
 
57
  ``` cpp
58
  constexpr byte operator|(byte l, byte r) noexcept;
59
  ```
60
 
61
  *Effects:* Equivalent to:
62
 
63
  ``` cpp
64
- return byte(static_cast<unsigned char>(l) | static_cast<unsigned char>(r));
65
  ```
66
 
67
  ``` cpp
68
  constexpr byte& operator&=(byte& l, byte r) noexcept;
69
  ```
70
 
71
- *Effects:* Equivalent to:
72
-
73
- ``` cpp
74
- return l = byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r));
75
- ```
76
 
77
  ``` cpp
78
  constexpr byte operator&(byte l, byte r) noexcept;
79
  ```
80
 
81
  *Effects:* Equivalent to:
82
 
83
  ``` cpp
84
- return byte(static_cast<unsigned char>(l) & static_cast<unsigned char>(r));
85
  ```
86
 
87
  ``` cpp
88
  constexpr byte& operator^=(byte& l, byte r) noexcept;
89
  ```
90
 
91
- *Effects:* Equivalent to:
92
-
93
- ``` cpp
94
- return l = byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r));
95
- ```
96
 
97
  ``` cpp
98
  constexpr byte operator^(byte l, byte r) noexcept;
99
  ```
100
 
101
  *Effects:* Equivalent to:
102
 
103
  ``` cpp
104
- return byte(static_cast<unsigned char>(l) ^ static_cast<unsigned char>(r));
105
  ```
106
 
107
  ``` cpp
108
  constexpr byte operator~(byte b) noexcept;
109
  ```
110
 
111
- *Effects:* Equivalent to: `return byte(s̃tatic_cast<unsigned char>(b));`
 
 
 
 
112
 
113
  ``` cpp
114
  template<class IntType>
115
  constexpr IntType to_integer(byte b) noexcept;
116
  ```
117
 
118
- *Remarks:* This function shall not participate in overload resolution
119
- unless `is_integral_v<IntType>` is `true`.
120
 
121
- *Effects:* Equivalent to: `return IntType(b);`
122
 
 
3
  ``` cpp
4
  template<class IntType>
5
  constexpr byte& operator<<=(byte& b, IntType shift) noexcept;
6
  ```
7
 
8
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
9
 
10
+ *Effects:* Equivalent to: `return b = b << shift;`
 
11
 
12
  ``` cpp
13
  template<class IntType>
14
  constexpr byte operator<<(byte b, IntType shift) noexcept;
15
  ```
16
 
17
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
18
 
19
  *Effects:* Equivalent to:
20
+
21
+ ``` cpp
22
+ return static_cast<byte>(static_cast<unsigned int>(b) << shift);
23
+ ```
24
 
25
  ``` cpp
26
  template<class IntType>
27
  constexpr byte& operator>>=(byte& b, IntType shift) noexcept;
28
  ```
29
 
30
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
31
 
32
+ *Effects:* Equivalent to: `return b = b >> shift;`
 
33
 
34
  ``` cpp
35
  template<class IntType>
36
  constexpr byte operator>>(byte b, IntType shift) noexcept;
37
  ```
38
 
39
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
40
 
41
  *Effects:* Equivalent to:
42
+
43
+ ``` cpp
44
+ return static_cast<byte>(static_cast<unsigned int>(b) >> shift);
45
+ ```
46
 
47
  ``` cpp
48
  constexpr byte& operator|=(byte& l, byte r) noexcept;
49
  ```
50
 
51
+ *Effects:* Equivalent to: `return l = l | r;`
 
 
 
 
52
 
53
  ``` cpp
54
  constexpr byte operator|(byte l, byte r) noexcept;
55
  ```
56
 
57
  *Effects:* Equivalent to:
58
 
59
  ``` cpp
60
+ return static_cast<byte>(static_cast<unsigned int>(l) | static_cast<unsigned int>(r));
61
  ```
62
 
63
  ``` cpp
64
  constexpr byte& operator&=(byte& l, byte r) noexcept;
65
  ```
66
 
67
+ *Effects:* Equivalent to: `return l = l & r;`
 
 
 
 
68
 
69
  ``` cpp
70
  constexpr byte operator&(byte l, byte r) noexcept;
71
  ```
72
 
73
  *Effects:* Equivalent to:
74
 
75
  ``` cpp
76
+ return static_cast<byte>(static_cast<unsigned int>(l) & static_cast<unsigned int>(r));
77
  ```
78
 
79
  ``` cpp
80
  constexpr byte& operator^=(byte& l, byte r) noexcept;
81
  ```
82
 
83
+ *Effects:* Equivalent to: `return l = l ^ r;`
 
 
 
 
84
 
85
  ``` cpp
86
  constexpr byte operator^(byte l, byte r) noexcept;
87
  ```
88
 
89
  *Effects:* Equivalent to:
90
 
91
  ``` cpp
92
+ return static_cast<byte>(static_cast<unsigned int>(l) ^ static_cast<unsigned int>(r));
93
  ```
94
 
95
  ``` cpp
96
  constexpr byte operator~(byte b) noexcept;
97
  ```
98
 
99
+ *Effects:* Equivalent to:
100
+
101
+ ``` cpp
102
+ return static_cast<byte>(~static_cast<unsigned int>(b));
103
+ ```
104
 
105
  ``` cpp
106
  template<class IntType>
107
  constexpr IntType to_integer(byte b) noexcept;
108
  ```
109
 
110
+ *Constraints:* `is_integral_v<IntType>` is `true`.
 
111
 
112
+ *Effects:* Equivalent to: `return static_cast<IntType>(b);`
113