Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #337
解决方案:
optional 的时候不判断 "null",而是判断 null 。 当类型是string,则单独针对它判断 " 开头,其他情况不允许 " 开头了。
测试:
windows 2019 + c++17 (原有的json测试用例在2019上实际会编译卡死,这个应该不是库的问题,测试时删除了异常的用例)
ubuntu 2204 gcc11.4.0
风险:
如果原来的应用依赖于,通过字符串再解析出 obj来,会异常;现在如果字段是非string,则value不能再 " 开头了。