Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
json-dto/json-dto.hpp
✓ #include <json-dto/json-dto.hpp>
Serialize a struct to JSON
#include <json-dto/json-dto.hpp>
#include <iostream>
struct person {
std::string name;
int age;
};
namespace json_dto {
template<typename JsonIO>
void json_io(JsonIO& io, person& p) {
io & "name" % p.name & "age" % p.age;
}
}
int main() {
person p{"Alice", 30};
std::string json = json_dto::to_json(p);
std::cout << json;
return 0;
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.