Parser Policies

The default parser policy is validating and disallows comments. The Unchecked variants will skip most error checks and can give a good performance boost; this is useful when you can trust and know the data will be free of malicious errors.

The predefined policies are:

Hash comments, a # in whitespace until end of line is comment.

C++ comments, either a // in whitespace until end of line, or between /* and */ in whitespace, are commments.

To change the policy from the default one for parsing, the following types/methods have a template argument for the PolicyType or an equivalent.

An example of parsing with C++ comments could be:

MyType value = daw::json::from_json<MyType, daw::json::CppCommentSkippingPolicyChecked>( json_string );