Skip to content
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

GenericDocument: add implicit conversion to ParseResult #480

Merged
merged 2 commits into from
Nov 27, 2015

Conversation

pah
Copy link
Contributor

@pah pah commented Nov 26, 2015

To simplify the error handling, this pull-request adds an implicit conversion of GenericDocument to ParseResult, allowing code like (already part of the documentation):

   ParseResult ok = doc.Parse(json);
   if (!ok) // ...

I have been bitten by this error in the docs in the discussion of #479.
Unittests are (slightly) updated as well.

To simplify the error handling, this commit adds an implicit conversion
of GenericDocument to ParseResult, allowing code like (already in the
documentation):

   ParseResult ok = doc.Parse(json);
   if (!ok) // ...
@mloskot
Copy link
Contributor

mloskot commented Nov 26, 2015

👍 thanks

miloyip added a commit that referenced this pull request Nov 27, 2015
GenericDocument: add implicit conversion to ParseResult
@miloyip miloyip merged commit 9d47c62 into Tencent:master Nov 27, 2015
@pah pah deleted the feature/document-parseresult branch November 27, 2015 15:53
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.

3 participants