Skip to content

Implement Value::demand() #901

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

Merged
merged 5 commits into from
Mar 30, 2019
Merged

Conversation

res2k
Copy link
Contributor

@res2k res2k commented Mar 23, 2019

There's a declaration of a Value::demand() method, but an implementation is nowhere to be found.

It would have some utility, though: it's the only method to create a named key that takes [begin, end) arguments. This is useful if you want to use a key stored in a string_view.

Note that I also changed the return value of demand():

  • I think a non-const pointer is more useful as you can immediately modify the Value.
  • Leaving it as a pointer keeps some symmetry with find().
  • This change doesn't affect compatibility much, as demand() wasn't implemented, thus there can't be any user of it.

@cdunn2001
Copy link
Contributor

Seems fine. I don't remember why this was not implemented. Personally, I like demand(), so thanks for this.

But you need to bump the minor version number.

@res2k
Copy link
Contributor Author

res2k commented Mar 23, 2019

But you need to bump the minor version number.

I guess the SOVERSION as well?

@cdunn2001
Copy link
Contributor

Yeah, that needs to match.

@cdunn2001 cdunn2001 merged commit cd11212 into open-source-parsers:master Mar 30, 2019
@res2k res2k deleted the demand branch April 7, 2019 10:42
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.

2 participants