Change macro based convert specializations to enable_if'd partial specializations for arithmetic types. #509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.