@@ -101,7 +101,7 @@ class ext_cref : public ext_ref_properties<OpType, Properties> {
101
101
explicit ext_cref (const field_cref &base) : base_(base) {}
102
102
explicit ext_cref (const aggregate_cref &base) : base_(base) {}
103
103
cref_type get () const { return base_; }
104
- bool present () const { return !this ->optional () || base_.present (); }
104
+ bool present () const { return !static_cast <cref_type*>( this ) ->optional () || base_.present (); }
105
105
106
106
private:
107
107
cref_type base_;
@@ -128,7 +128,7 @@ class ext_cref<decimal_cref, std::tuple<ExponentOp, MantissaOp>, Properties> {
128
128
exponent_type get_exponent () const {
129
129
return exponent_type (base_.get_exponent ());
130
130
}
131
- bool present () const { return !this ->optional () || base_.present (); }
131
+ bool present () const { return !static_cast <cref_type*>( this ) ->optional () || base_.present (); }
132
132
133
133
private:
134
134
decimal_cref base_;
@@ -193,7 +193,7 @@ class ext_cref<nested_message_cref, group_type_tag, Properties>
193
193
194
194
explicit ext_cref (const field_cref &other) : base_(other) {}
195
195
cref_type get () const { return cref_type (aggregate_cref (base_)[0 ]); }
196
- bool present () const { return !this ->optional () || base_.present (); }
196
+ bool present () const { return !static_cast <cref_type*>( this ) ->optional () || base_.present (); }
197
197
198
198
private:
199
199
field_cref base_;
@@ -211,7 +211,7 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
211
211
212
212
ext_mref (field_mref other) : base_(std::move(other)) {}
213
213
mref_type set () const {
214
- if (this ->optional ()) {
214
+ if (static_cast <mref_type*>( this ) ->optional ()) {
215
215
value_storage *storage = field_mref_core_access::storage_of (this ->base_ );
216
216
storage->present (true );
217
217
}
@@ -224,9 +224,9 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
224
224
;
225
225
}
226
226
227
- bool present () const { return !this ->optional () || base_.present (); }
227
+ bool present () const { return !static_cast <mref_type*>( this ) ->optional () || base_.present (); }
228
228
void omit () const {
229
- if (this ->optional ())
229
+ if (static_cast <mref_type*>( this ) ->optional ())
230
230
base_.omit ();
231
231
}
232
232
@@ -341,16 +341,16 @@ class ext_mref<nested_message_mref, group_type_tag, Properties>
341
341
explicit ext_mref (field_mref other) : base_(std::move(other)) {}
342
342
cref_type get () const { return cref_type (aggregate_cref (base_)[0 ]); }
343
343
mref_type set () const {
344
- if (this ->optional ()) {
344
+ if (static_cast <mref_type*>( this ) ->optional ()) {
345
345
value_storage *storage = field_mref_core_access::storage_of (this ->base_ );
346
346
storage->present (true );
347
347
}
348
348
return mref_type (aggregate_mref (base_)[0 ]);
349
349
}
350
350
351
- bool present () const { return !this ->optional () || base_.present (); }
351
+ bool present () const { return !static_cast <mref_type*>( this ) ->optional () || base_.present (); }
352
352
void omit () const {
353
- if (this ->optional ())
353
+ if (static_cast <mref_type*>( this ) ->optional ())
354
354
base_.omit ();
355
355
}
356
356
0 commit comments