-
Notifications
You must be signed in to change notification settings - Fork 88
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
How to know if the ryml::Tree is empty? #272
Comments
Yes, this is a nagging corner case that requires attention. IIRC the parser will always create the root node, thus causing this behavior. As a workaround, you can query the number of children of the root node. |
Got it, thanks for the quick reply! |
Let's not close this yet. This issue is something that should be addressed, at the very least by clarifying it in the docs, and preferably by having a behavior that is less surprising. |
Hello!
I've got this use case for the rapidyaml library:
The output for which is
tree.empty() = 0
. Apparently them_size
member ofryml::Tree
is set to 1 after parsing.How do I check if the input text contains no yaml nodes? Am I misusing rapidyaml?
The version I'm using is 0.4.1 (the latest release), built as a single header library.
The text was updated successfully, but these errors were encountered: