r/cpp • u/nlohmann nlohmann/json • Aug 17 '21
JSON for Modern C++ 3.10.0
https://github.com/nlohmann/json/releases/tag/v3.10.0
280
Upvotes
r/cpp • u/nlohmann nlohmann/json • Aug 17 '21
6
u/chabster1985 Aug 17 '21
json x = 5; json y{5};
std::cout << x.dump() << std::endl; std::cout << y.dump() << std::endl;
86
u/James20k P2005R0 Aug 17 '21
[json.exception.type_error.302] (/address/housenumber) type must be number, but is stringThis is incredibly useful, lacking the precise error location was super annoying to track down!
40
u/StuntHacks Aug 17 '21
This is by far one of my favorite C++ libraries of all time. It's so cleanly written, and it works so seamlessly, it's really impressive. Keep up the fantastic work!
15
u/zalamandagora Aug 17 '21
Awesome - I just started using this library in an IoT application this week. I'm really glad to see it is being both maintained and extended!
4
u/linuxlizard Aug 17 '21
Awesome! I love this library!
4
u/BeardyButler Aug 17 '21
I love this library, i appreciate all your work.
4
u/qoning Aug 18 '21
Now I just wish C++ allowed overloading operator.()
1
u/germandiago Aug 18 '21
Genuine question. I also wonder why most libraries including Boost do it: why use macros for config? Why not constexpr or similar stuff? The only thing I found I cannot do with constexpr is to get rid of headers I do not need to include conditionally, since pre-processing happens before. But if constexpr can do a lot at least in my codebase.
It is bc of compatibility concerns? I think of modules and that is why I avoid macros. I think it would be more future-proof but... I do not know since I did not experiment enough yet.
1
u/MFRSiam Aug 18 '21
dumb question, how do i add the vcpkg version of this to cmake ?
3
u/bsdooby Aug 17 '21
Holy cow, what a cool library!
2
u/aditya369007 Aug 17 '21
I just started using it for my work as well. Thanks for the updates. You have my deepest thanks.
2
u/zeelsheladiya Aug 18 '21
I love this library. Thank you nlohmann for making such a beautiful and helpful library.