Skip to content

Commit 1057575

Browse files
committed
Correct enum code
1 parent c11bfa4 commit 1057575

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/mfast/enum_ref.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ class MFAST_EXPORT enum_cref : public field_cref {
4545
}
4646
bool is_boolean() const;
4747

48+
protected:
49+
friend class mfast::detail::codec_helper;
50+
51+
void save_to(value_storage &v) const {
52+
v.of_uint64.content_ = this->storage()->of_uint64.content_;
53+
v.defined(true);
54+
v.present(this->present());
55+
}
56+
4857
private:
4958
enum_cref &operator=(const enum_cref &);
5059
};
@@ -70,6 +79,7 @@ class enum_mref : public make_field_mref<enum_cref> {
7079

7180
enum_mref(const enum_mref &) = default;
7281

82+
explicit enum_mref(const field_mref_base &other) : base_type(other) {}
7383
void as(const enum_cref &cref) const {
7484
if (cref.absent()) {
7585
this->omit();

src/mfast/ext_ref.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,10 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
250250
storage->present(true);
251251
}
252252
return mref_type(base_);
253-
;
254253
}
255254

256255
cref_type get() const {
257256
return cref_type(base_);
258-
;
259257
}
260258

261259
bool present() const { return !this->optional() || base_.present(); }

0 commit comments

Comments
 (0)