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.
daw/json/daw_json_link.h
✓ #include <daw/json/daw_json_link.h>
Deserialize JSON to a struct using daw_json_link
#include <daw/json/daw_json_link.h>
#include <iostream>
#include <string>
struct Point { double x, y; };
namespace daw::json {
template<>
struct json_data_contract<Point> {
static constexpr auto to_json_data = make_member_list(
"x", &Point::x,
"y", &Point::y
);
};
}
int main() {
std::string json = R"({"x":1.0,"y":2.0})";
Point p = daw::json::from_json<Point>(json);
std::cout << p.x << ", " << p.y << std::endl;
return 0;
}
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.