@@ -101,7 +101,7 @@ class ext_cref : public ext_ref_properties<OpType, Properties> {
101101 explicit ext_cref (const field_cref &base) : base_(base) {}
102102 explicit ext_cref (const aggregate_cref &base) : base_(base) {}
103103 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 (); }
105105
106106private:
107107 cref_type base_;
@@ -128,7 +128,7 @@ class ext_cref<decimal_cref, std::tuple<ExponentOp, MantissaOp>, Properties> {
128128 exponent_type get_exponent () const {
129129 return exponent_type (base_.get_exponent ());
130130 }
131- bool present () const { return !this ->optional () || base_.present (); }
131+ bool present () const { return !static_cast <cref_type*>( this ) ->optional () || base_.present (); }
132132
133133private:
134134 decimal_cref base_;
@@ -193,7 +193,7 @@ class ext_cref<nested_message_cref, group_type_tag, Properties>
193193
194194 explicit ext_cref (const field_cref &other) : base_(other) {}
195195 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 (); }
197197
198198private:
199199 field_cref base_;
@@ -211,7 +211,7 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
211211
212212 ext_mref (field_mref other) : base_(std::move(other)) {}
213213 mref_type set () const {
214- if (this ->optional ()) {
214+ if (static_cast <mref_type*>( this ) ->optional ()) {
215215 value_storage *storage = field_mref_core_access::storage_of (this ->base_ );
216216 storage->present (true );
217217 }
@@ -224,9 +224,9 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
224224 ;
225225 }
226226
227- bool present () const { return !this ->optional () || base_.present (); }
227+ bool present () const { return !static_cast <mref_type*>( this ) ->optional () || base_.present (); }
228228 void omit () const {
229- if (this ->optional ())
229+ if (static_cast <mref_type*>( this ) ->optional ())
230230 base_.omit ();
231231 }
232232
@@ -341,16 +341,16 @@ class ext_mref<nested_message_mref, group_type_tag, Properties>
341341 explicit ext_mref (field_mref other) : base_(std::move(other)) {}
342342 cref_type get () const { return cref_type (aggregate_cref (base_)[0 ]); }
343343 mref_type set () const {
344- if (this ->optional ()) {
344+ if (static_cast <mref_type*>( this ) ->optional ()) {
345345 value_storage *storage = field_mref_core_access::storage_of (this ->base_ );
346346 storage->present (true );
347347 }
348348 return mref_type (aggregate_mref (base_)[0 ]);
349349 }
350350
351- bool present () const { return !this ->optional () || base_.present (); }
351+ bool present () const { return !static_cast <mref_type*>( this ) ->optional () || base_.present (); }
352352 void omit () const {
353- if (this ->optional ())
353+ if (static_cast <mref_type*>( this ) ->optional ())
354354 base_.omit ();
355355 }
356356
0 commit comments