@@ -119,29 +119,17 @@ struct Decimal : Expr<Base>
119
119
Expr<To> to () { return val ().template to <To>() / powi (To (10 ), To (scale_)); }
120
120
121
121
Decimal clone () const { return Decimal (expr_type::clone (), scale_); }
122
- bool can_be_null () const { return expr_type::can_be_null (); }
123
- Bool is_null () {
124
- if (can_be_null ()) {
125
- return expr_type::is_null ();
126
- } else {
127
- expr_type::discard ();
128
- return Bool (false );
129
- }
130
- }
131
- Bool not_null () {
132
- if (can_be_null ()) {
133
- return expr_type::not_null ();
134
- } else {
135
- expr_type::discard ();
136
- return Bool (true );
137
- }
138
- }
139
122
140
123
141
124
/* ------------------------------------------------------------------------------------------------------------------
142
125
* Unary operations
143
126
*----------------------------------------------------------------------------------------------------------------*/
144
127
128
+ /* * Bitwise negation is not supported by `Decimal` type. */
129
+ Decimal operator ~()
130
+ requires false
131
+ { M_unreachable (" modulo division on decimals is not defined" ); }
132
+
145
133
146
134
/* ------------------------------------------------------------------------------------------------------------------
147
135
* Binary operations
@@ -210,6 +198,42 @@ struct Decimal : Expr<Base>
210
198
requires false
211
199
Decimal operator %(T&&) { M_unreachable (" modulo division on decimals is not defined" ); }
212
200
201
+ /* * Bitwise and is not supported by `Decimal` type. */
202
+ template <typename T>
203
+ requires false
204
+ Decimal operator bitand (T&&) { M_unreachable (" bitwise and on decimals is not defined" ); }
205
+
206
+ /* * Bitwise or is not supported by `Decimal` type. */
207
+ template <typename T>
208
+ requires false
209
+ Decimal operator bitor (T&&) { M_unreachable (" bitwise or on decimals is not defined" ); }
210
+
211
+ /* * Bitwise xor (exclusive or) is not supported by `Decimal` type. */
212
+ template <typename T>
213
+ requires false
214
+ Decimal operator xor (T&&) { M_unreachable (" exclusive or on decimals is not defined" ); }
215
+
216
+ /* * Shift left is not supported by `Decimal` type. */
217
+ template <typename T>
218
+ requires false
219
+ Decimal operator <<(T&&) { M_unreachable (" shift left on decimals is not defined" ); }
220
+
221
+ /* * Shift right is not supported by `Decimal` type. */
222
+ template <typename T>
223
+ requires false
224
+ Decimal operator >>(T&&) { M_unreachable (" shift right on decimals is not defined" ); }
225
+
226
+ /* * Shift right is not supported by `Decimal` type. */
227
+ template <typename T>
228
+ requires false
229
+ Decimal rotl (T&&) { M_unreachable (" rotate left on decimals is not defined" ); }
230
+
231
+ /* * Shift right is not supported by `Decimal` type. */
232
+ template <typename T>
233
+ requires false
234
+ Decimal rotr (T&&) { M_unreachable (" rotate right on decimals is not defined" ); }
235
+
236
+
213
237
friend std::ostream & operator <<(std::ostream &out, const Decimal &d) {
214
238
return out << " Decimal: " << static_cast <const expr_type&>(d) << " , scale = " << d.scale_ ;
215
239
}
0 commit comments