You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First I receive a compiler warning saying discarding return value with a function declared with 'nodiscard' attribute and second I wan to be able to parse the message without wrapping the entire rest of my function in the exception handler. For instance I can just parse it twice like so.
Once to check if there's an error and the second to store the value in packet. Then I can use the packet structure, but that isn't very efficient because I'm parsing the message twice. I also can't store the return value in an auto type outside the block scope and assign it inside the block because auto wouldn't work that way. Essentially what I'm asking is, what does json::parse return so I can declare a variable for it outside the try catch and assign it inside the try catch then check if the assigned variable is valid.
The text was updated successfully, but these errors were encountered:
I was reading through your examples I noticed your parse error example
First I receive a compiler warning saying discarding return value with a function declared with 'nodiscard' attribute and second I wan to be able to parse the message without wrapping the entire rest of my function in the exception handler. For instance I can just parse it twice like so.
Once to check if there's an error and the second to store the value in packet. Then I can use the packet structure, but that isn't very efficient because I'm parsing the message twice. I also can't store the return value in an auto type outside the block scope and assign it inside the block because auto wouldn't work that way. Essentially what I'm asking is, what does json::parse return so I can declare a variable for it outside the try catch and assign it inside the try catch then check if the assigned variable is valid.
The text was updated successfully, but these errors were encountered: