Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change macro based convert specializations to enable_if'd partial specializations for arithmetic types. #509

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

leni536
Copy link

@leni536 leni536 commented Jul 4, 2017

It changes the macro based specializations for arithmetic types to partial template specializations using enable_if to differentiate between the different cases (character, signed/unsigned integral and floating point). For bonus points this should handle fixed width integer types too. This would have been cumbersome with the macro as some of these types are optional.

It also fixes #507.

In LoadNodeTest.NumericConversion I rewrote the scalar value "015" to "0o15". According to YAML 1.2 both should resolve to !!int, but the first is base 10, the second is base 8.

I just now see that bool decode is pretty problematic too. According to YAML 1.2 core schema only true|True|TRUE|false|False|FALSE should be resolved as !!bool. So no "y", "yes", "TrUe", and stuff like that.

Probably in this form this pull request is too dirty. I use the c++11 regex library which just seems wrong especially in the header.

Anyway this is my first ever pull request, please be patient with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

constructing Node from NaN and Inf emits "nan" and "inf" respectively, breaking the core schema regexes.
2 participants