Skip to content

We use this library in a network program.There is a situation we have to overcome. #2464

Answered by gregmarr
helloword010 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use this function to check before parsing, but then you basically have to parse every message at least twice. Depending on why you are trying to avoid exceptions, that may be an acceptable trade-off.

accept()
check if the input is valid JSON
Unlike the parse(InputType&&, const parser_callback_t,const bool)
function, this function neither throws an exception in case of invalid JSON
input (i.e., a parse error) nor creates diagnostic information.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by helloword010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants