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
With yaml-cpp version 0.8.0, when I use YAML::Emitter to emit a uint8_t in a yaml document, the result is different from other integer types. It seems that it is emitted in a quoted hexadecimal representation.
A side effect of this is that a BadConversion exception is thrown when you try to convert a uint8_t emitted with YAML::Emitter.
The issue here is that uint8_t is treated as a string. If you set uint8_t uint8{120} it should print "x".
So what is the behavior we expect? All ints printed as ints, or similar behavior to std::stringstream or std::cout which treat it as single characters?
Bug description
With yaml-cpp version 0.8.0, when I use
YAML::Emitter
to emit auint8_t
in a yaml document, the result is different from other integer types. It seems that it is emitted in a quoted hexadecimal representation.A side effect of this is that a
BadConversion
exception is thrown when you try to convert auint8_t
emitted withYAML::Emitter
.Might be link with #1081
Reproduction
Test code
Result
With yaml-cpp version 0.8.0
Workaround
Do a static cast to another integer type before emitting:
The text was updated successfully, but these errors were encountered: