ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.05k stars 372 forks source link

fix(string_stream): add missing initializations of const format specifiers #849

Closed KnoerleMaTLS closed 3 months ago

KnoerleMaTLS commented 4 months ago

This pull request introduces a possible fix for the issue #848 by adding the missing initializers.

semanticdiff-com[bot] commented 4 months ago

Review changes with SemanticDiff.

jwellbelove commented 4 months ago

Were you getting warning from the compiler?

KnoerleMaTLS commented 4 months ago

Warning about what/where? Regarding the propsed fix?

jwellbelove commented 4 months ago

Did you get errors or warnings about 'missing initializers'? left_spec & right_spec have default constructors, so they shouldn't need explicit initialisation.

KnoerleMaTLS commented 4 months ago

Yeah, i got compiler errors about missing initializers for left and right. Please check #848 for further details.

Yes, the structs left_spec and right_spec have compiler generated default constructors, but regarding the C++ standard this is not enough to initialize a const object ("default-initialization of a const object could not call an implicitly declared default constructor"). I also tried to explain this in more detail in the mentioned issue.