@@ -112,85 +112,87 @@ struct SafeEnum {
112
112
*/
113
113
typedef LayoutType representation_t ;
114
114
115
+ protected:
115
116
/* *
116
117
* Construction of an enumeration value.
117
118
*/
118
- SafeEnum (LayoutType value) : _value(value) { }
119
+ explicit SafeEnum (LayoutType value) : _value(value) { }
119
120
121
+ public:
120
122
/* *
121
- * Equal to operator for SafeEnum instances.
123
+ * Equal to operator for Target instances.
122
124
*
123
125
* @param lhs left hand side of the comparison
124
126
* @param rhs right hand side of the comparison
125
127
*
126
128
* @return true if the inner value of lhs and rhs are equal and false
127
129
* otherwise.
128
130
*/
129
- friend bool operator ==(SafeEnum lhs, SafeEnum rhs) {
131
+ friend bool operator ==(Target lhs, Target rhs) {
130
132
return lhs._value == rhs._value ;
131
133
}
132
134
133
135
/* *
134
- * Not equal to operator for SafeEnum instances.
136
+ * Not equal to operator for Target instances.
135
137
*
136
138
* @param lhs left hand side of the comparison
137
139
* @param rhs right hand side of the comparison
138
140
*
139
141
* @return true if the inner value of lhs and rhs are not equal and false
140
142
* otherwise.
141
143
*/
142
- friend bool operator !=(SafeEnum lhs, SafeEnum rhs) {
144
+ friend bool operator !=(Target lhs, Target rhs) {
143
145
return !(lhs == rhs);
144
146
}
145
147
146
148
/* *
147
- * Less than operator for SafeEnum instances.
149
+ * Less than operator for Target instances.
148
150
*
149
151
* @param lhs left hand side of the comparison
150
152
* @param rhs right hand side of the comparison
151
153
*
152
154
* @return true if the inner value of lhs is less than rhs and false otherwise.
153
155
*/
154
- friend bool operator <(SafeEnum lhs, SafeEnum rhs) {
156
+ friend bool operator <(Target lhs, Target rhs) {
155
157
return lhs.value () < rhs.value ();
156
158
}
157
159
158
160
/* *
159
- * Less than or equal to operator for SafeEnum instances.
161
+ * Less than or equal to operator for Target instances.
160
162
*
161
163
* @param lhs left hand side of the comparison
162
164
* @param rhs right hand side of the comparison
163
165
*
164
166
* @return true if the inner value of lhs is less than or equal to rhs and
165
167
* false otherwise.
166
168
*/
167
- friend bool operator <=(SafeEnum lhs, SafeEnum rhs) {
169
+ friend bool operator <=(Target lhs, Target rhs) {
168
170
return lhs.value () < rhs.value () || lhs == rhs;
169
171
}
170
172
171
173
/* *
172
- * Greater than operator for SafeEnum instances.
174
+ * Greater than operator for Target instances.
173
175
*
174
176
* @param lhs left hand side of the comparison
175
177
* @param rhs right hand side of the comparison
176
178
*
177
179
* @return true if the inner value of lhs is greater than rhs; false
178
180
* otherwise.
179
181
*/
180
- friend bool operator >(SafeEnum lhs, SafeEnum rhs) {
182
+ friend bool operator >(Target lhs, Target rhs) {
181
183
return !(lhs <= rhs);
182
184
}
183
185
184
186
/* *
185
- * Greater than or equal to operator for SafeEnum instances.
187
+ * Greater than or equal to operator for Target instances.
186
188
*
187
189
* @param lhs left hand side of the comparison
188
190
* @param rhs right hand side of the comparison
189
191
*
190
192
* @return true if the inner value of lhs is greater than or equal to rhs;
191
193
* false otherwise.
192
194
*/
193
- friend bool operator >=(SafeEnum lhs, SafeEnum rhs) {
195
+ friend bool operator >=(Target lhs, Target rhs) {
194
196
return !(lhs < rhs);
195
197
}
196
198
0 commit comments