技术栈
nlohmann_json库
雪域迷影
16 小时前
c++
·
json
·
nlohmann_json库
nlohmann::json库对象和json结构体转换的新方式
nlohmann::json库官方地址为:https://json.nlohmann.me/,Github源代码托管地址为:https://github.com/nlohmann/json 在nlohmann json库 3.9.0 版本之前,如果将自定义类或者结构体对象之间相关转换,需要自定义对应的to_json和from_json这两个函数。但是从3.9.0版本以后有6个宏可以替我们完成这项事情,具体可以参考官方文档:
我是有底线的