GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com

#include "struct_mapping/struct_mapping.h" #include #include #include #include struct Engine { int age; }; struct Car { std::optional engine; std::optional name; std::optional max_speed; }; int main() { struct_mapping::reg(&Engine::age, "age"); struct_mapping::reg(&Car::engine, "engine"); struct_mapping::reg(&Car::name, "name", struct_mapping::NotEmpty{}); struct_mapping::reg(&Car::max_speed, "max_speed", struct_mapping::Bounds{0, 100}); std::istringstream json_data(R"json( { "engine": { "age": 42 }, "name": "Mercedes" } )json"); Car car; struct_mapping::map_json_to_struct(car, json_data); std::ostringstream out_json_data; struct_mapping::map_struct_to_json(car, out_json_data, " ", false); std::cout << out_json_data.str() << std::endl; }
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.