Skip to content

zcteo/json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSON for Modern C++ Wrapper

Wrapper for JSON for Modern C++

using json = nlohmann::json;

struct Foo
{
    std::string name;
    int age;
    JSON_DEFINE_INTRUSIVE_MAP(Foo, NAME, name, AGE, age);
};

int main()
{
    Foo foo{"ZhangSan", 20};
    json j = foo;
    std::cout << j.dump(2) << std::endl;
    return 0;
}

output

{
  "AGE": 20,
  "NAME": "ZhangSan"
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages