You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have split single constructor to empty constructor and constructor with allocator_type
Field constructor was improved to support {} - i.e. default template parameters were added
construction with {} cannot work for structures with single field since the constructor is ambiguous (ambiguity with copy constructor...) const TestStruct testStruct = TestStruct(10, {}, "sample", {});
Note that when structure has optional fields and {} is used as a field constructor parameter, it DOES NOT mean that optional field is not present (NullOpt) but empty constructor is used to create optional field.
const TestStruct testStructWithDefaultOptional = TestStruct("sample", {}); // {} does not mean NullOpt!
const TestStruct testStructWithDefaultOptional = TestStruct("sample", uint32_t()); // same as above
// vs.
const TestStruct testStructWithoutOptional = TestStruct("sample", zserio::NullOpt);
Currently, Zserio objects in C++ do have the following default constructor:
This prevents calling of empty constructor implicitly. Example:
This could be potentionally cumbersome for example if
ZserioObject
is passed as parameter.The solution could be to split this constructor as follows:
The text was updated successfully, but these errors were encountered: