#127 Generalize conversions between nodes and native data #129
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.
Conversions between
basic_node
objects and native data objects have been generalized by newly implementednode_value_converter
class.The
node_value_converter
delegates converting operations tofkyaml::to_node
andfkyaml::from_node
fanctor objects which will execute functions implemented for a target native data type with the mechanism of the Argument Dependent Lookup (ADL for short).User customizations are available by implementing custom
to_node()
/from_node()
OUTSIDE the fkyaml namespace. (maybe in the global namespace.)The current restriction of the
from_node()
customization is that target native data types MUST be default constructible.The restriction above will be fixed in some later PR.
Furthermore, implementations of STL supplementation to use features in C++14 or later has been moved to
include/fkYAML/stl_supplement.hpp
, which depends on the result of the C++ standard detection executed ininclude/fkYAML/version_macros.hpp
.