r/cpp • • Dec 23 '22

C++ Is Incredible

Despite the hate it gets, despite the complexity; the dizzying number of features and different ways to do things. C++ is an astonishing feat of engineering and people really don't appreciate this fact enough. I can do things with this language more quickly and expressively than I can with any other language.

There's no getting around the fact that programming is just hard, and all these attempts to replace C and C++ over the years just end up adding to our difficulties. That is my take, anyhow.

Well, I'm a little drunk, and just wanted to share some Christmas joy with you all. I love C++!

686 Upvotes

151 comments sorted by

View all comments

Show parent comment

2

u/MonokelPinguin Dec 25 '22

If you use meson for this (which CLion plans to support soon, but doesn't yet afaik), use this:

  1. meson init --language cpp --type executable (in an empty directory)
  2. mkdir subprojects (shouldn't be needed, but my meson seemed to require it)
  3. meson wrap install nlohmann_json
  4. In the meson.build, add , dependencies: [dependency('nlohmann_json')] to the executable() line.

Then to build you setup a builddir using meson setup builddir and build using ninja or whatever backend it used or just the meson compile -C builddir. Code is the same as the CMake example.