@@ -186,10 +186,6 @@ template <class T> struct DefaultErrorVisitor : DefaultNullVisitor {
186
186
bool throw_error () { throw SerializationError{(static_cast <T&>(*this )).get_err_msg ()}; }
187
187
188
188
std::string get_err_msg () { return std::string{T::static_err_msg}; }
189
-
190
- private:
191
- DefaultErrorVisitor () = default ;
192
- friend T; // CRTP compliance
193
189
};
194
190
195
191
struct visit_map_t ;
@@ -242,8 +238,6 @@ struct MapArrayVisitor : DefaultErrorVisitor<MapArrayVisitor<map_array>> {
242
238
assert (size == 0 );
243
239
return true ;
244
240
}
245
-
246
- MapArrayVisitor () = default ;
247
241
};
248
242
249
243
struct StringVisitor : DefaultErrorVisitor<StringVisitor> {
@@ -254,8 +248,6 @@ struct StringVisitor : DefaultErrorVisitor<StringVisitor> {
254
248
str = {v, size};
255
249
return true ;
256
250
}
257
-
258
- StringVisitor () = default ;
259
251
};
260
252
261
253
struct BoolVisitor : DefaultErrorVisitor<BoolVisitor> {
@@ -266,8 +258,6 @@ struct BoolVisitor : DefaultErrorVisitor<BoolVisitor> {
266
258
value = v;
267
259
return true ;
268
260
}
269
-
270
- BoolVisitor () = default ;
271
261
};
272
262
273
263
template <class T > struct ValueVisitor ;
@@ -292,8 +282,6 @@ template <std::integral T> struct ValueVisitor<T> : DefaultErrorVisitor<ValueVis
292
282
value = static_cast <T>(v);
293
283
return true ;
294
284
}
295
-
296
- ValueVisitor (T& v) : DefaultErrorVisitor<ValueVisitor<T>>{}, value{v} {}
297
285
};
298
286
299
287
template <> struct ValueVisitor <double > : DefaultErrorVisitor<ValueVisitor<double >> {
@@ -318,8 +306,6 @@ template <> struct ValueVisitor<double> : DefaultErrorVisitor<ValueVisitor<doubl
318
306
value = v;
319
307
return true ;
320
308
}
321
-
322
- ValueVisitor (double & v) : DefaultErrorVisitor<ValueVisitor<double >>{}, value{v} {}
323
309
};
324
310
325
311
template <> struct ValueVisitor <RealValue<asymmetric_t >> : DefaultErrorVisitor<ValueVisitor<RealValue<asymmetric_t >>> {
@@ -371,8 +357,6 @@ template <> struct ValueVisitor<RealValue<asymmetric_t>> : DefaultErrorVisitor<V
371
357
value[idx] = v;
372
358
return true ;
373
359
}
374
-
375
- ValueVisitor (RealValue<asymmetric_t >& v) : DefaultErrorVisitor<ValueVisitor<RealValue<asymmetric_t >>>{}, value{v} {}
376
360
};
377
361
378
362
} // namespace detail
@@ -675,8 +659,7 @@ class Deserializer {
675
659
size_t const scenario_offset = offset_;
676
660
// skip all the real content but check if it has map
677
661
bool const has_map = parse_skip_check_map ();
678
- count_per_scenario.push_back (
679
- {.component = component_key_, .size = component_size, .offset = scenario_offset, .has_map = has_map});
662
+ count_per_scenario.push_back ({component_key_, component_size, scenario_offset, has_map});
680
663
}
681
664
component_key_ = {};
682
665
return count_per_scenario;
@@ -725,8 +708,8 @@ class Deserializer {
725
708
elements_per_scenario * batch_size; // multiply
726
709
handler.add_component_info (component_key_, elements_per_scenario, total_elements);
727
710
// check if all scenarios only contain array data
728
- bool const only_values_in_data =
729
- std::ranges::none_of (component_byte_meta, [](auto const & x) { return x.has_map ; });
711
+ bool const only_values_in_data = std::none_of (component_byte_meta. cbegin (), component_byte_meta. cend (),
712
+ [](auto const & x) { return x.has_map ; });
730
713
msg_data_offsets_.push_back (std::move (component_byte_meta));
731
714
// enable attribute indications if possible
732
715
if (only_values_in_data) {
@@ -960,7 +943,7 @@ class Deserializer {
960
943
961
944
ctype_func_selector (attribute.ctype , [&buffer_view, &component, &attribute, this ]<class T > {
962
945
ValueVisitor<T> visitor{
963
- attribute.get_attribute <T>(component.advance_ptr (buffer_view.buffer ->data , buffer_view.idx ))};
946
+ {}, attribute.get_attribute <T>(component.advance_ptr (buffer_view.buffer ->data , buffer_view.idx ))};
964
947
msgpack::parse (data_, size_, offset_, visitor);
965
948
});
966
949
}
@@ -971,7 +954,7 @@ class Deserializer {
971
954
assert (buffer.meta_attribute != nullptr );
972
955
973
956
ctype_func_selector (buffer.meta_attribute ->ctype , [&buffer, &idx, this ]<class T > {
974
- ValueVisitor<T> visitor{*(reinterpret_cast <T*>(buffer.data ) + idx)};
957
+ ValueVisitor<T> visitor{{}, *(reinterpret_cast <T*>(buffer.data ) + idx)};
975
958
msgpack::parse (data_, size_, offset_, visitor);
976
959
});
977
960
}
0 commit comments