@@ -85,6 +85,7 @@ class Writer {
8585
8686 OutputArrayType add_array_to_union (const size_t _index, const size_t _size,
8787 OutputUnionType* _parent) const {
88+ (*archive_)(_index);
8889 (*archive_)(::cereal::make_size_tag (_size));
8990 return OutputArrayType{};
9091 }
@@ -111,6 +112,7 @@ class Writer {
111112
112113 OutputMapType add_map_to_union (const size_t _index, const size_t _size,
113114 OutputUnionType* _parent) const {
115+ (*archive_)(_index);
114116 (*archive_)(::cereal::make_size_tag (_size));
115117 return OutputMapType{};
116118 }
@@ -134,6 +136,7 @@ class Writer {
134136
135137 OutputObjectType add_object_to_union (const size_t _index, const size_t _size,
136138 OutputUnionType* _parent) const {
139+ (*archive_)(_index);
137140 return OutputObjectType{};
138141 }
139142
@@ -153,6 +156,7 @@ class Writer {
153156
154157 OutputUnionType add_union_to_union (const size_t _index,
155158 OutputUnionType* _parent) const {
159+ (*archive_)(_index);
156160 return OutputUnionType{};
157161 }
158162
@@ -179,6 +183,7 @@ class Writer {
179183 template <class T >
180184 OutputVarType add_value_to_union (const size_t _index, const T& _var,
181185 OutputUnionType* _parent) const {
186+ (*archive_)(_index);
182187 (*archive_)(_var);
183188 return OutputVarType{};
184189 }
@@ -199,6 +204,7 @@ class Writer {
199204
200205 OutputVarType add_null_to_union (const size_t _index,
201206 OutputUnionType* _parent) const {
207+ (*archive_)(_index);
202208 return OutputVarType{};
203209 }
204210
0 commit comments