-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add to_node() implementations for STL container types #465
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fktn-k
changed the title
Add builtin implementations of to_node() for STL container types
Add to_node() implementations for STL container types
Jan 14, 2025
Upload Coverage Event NotificationCoverage data has been uploaded for the commit 0967aee22bc4a92d96bddc1e38fd2acae37897f7.
|
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR has added builtin implementations of the
to_node()
function which are used when constructing afkyaml::basic_node
object with arbitrary types.Before this PR, minimal builtin implementation was provided so that converting to a basic_node object from its template parameter types (like
fkyaml::basic_node::sequence_type
), which wasn't much helpful.Now, objects of many existing STL container types (like
std::vector
,std::unordered_map
orstd::tuple
) can be used as an argument of thefkyaml::basic_node
constructor.See the updated documentation for supported STL container types.
Furthermore, you can, of course, provide your own custom
to_node()
implementation for non-standard types just as before and such a type can be used as the element type of STL container types.If you run the following code, for example:
then the output will be:
Pull Request Checklist
Read the CONTRIBUTING.md file for detailed information.
Please don't
#ifdef
s or other means.