We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
eg 定义: struct input { std::string name; std::string id; XTOSTRUCT(M(name,id)); }; json: { "name": "Tom", "id":1 } id 类型为int而不是string 没有错误,没有异常。 这个问题比较严重
The text was updated successfully, but these errors were encountered:
#include <iostream> #include "x2struct/x2struct.hpp" // 包含这个头文件 using namespace std; struct input { string name; string id; XTOSTRUCT(O(name, id)); }; int main(int argc, char *argv[]) { string s = "{\"name\":\"Tom\", \"id\":1}"; input in; x2struct::X::loadjson(s, in, false); return 0; }
output:
terminate called after throwing an instance of 'std::runtime_error' what(): IsString()[id] Aborted (core dumped)
你看看是不是上层有catch?
Sorry, something went wrong.
可以catch ,谢谢
No branches or pull requests
eg
定义:
struct input
{
std::string name;
std::string id;
XTOSTRUCT(M(name,id));
};
json:
{
"name": "Tom",
"id":1
}
id 类型为int而不是string
没有错误,没有异常。
这个问题比较严重
The text was updated successfully, but these errors were encountered: