logoalt Hacker News

werdnapktoday at 12:12 PM3 repliesview on HN

I used to live and breath C++ early 2000s, but haven't touched it since. I can't make sense of modern C++.


Replies

TuxSHtoday at 1:45 PM

> I can't make sense of modern C++

A lot of it is about making metaprogramming a lot easier to write and to read.

No more enable_if kludges since if constexpr (and concepts for specific stuff); and using concepts allows to better communicate intent (e.g.: template<typename I> can become template<std::integral I> if you want the template to be used only with integer types, and so on)

keldaristoday at 12:22 PM

Thankfully, you can still write C++ just fine without the "modern" stuff and have not only readable code, but also sane compile times. The notion, explicitly mentioned in the article, that all this insane verbosity also adds 5 seconds to your build for a single executor invocation is just crazy to me (it is far longer than my entire build for most projects).

show 1 reply
SJC_Hackertoday at 2:04 PM

You may want to watch some of Herb Sutters videos. He is one of the few sane people left in the upper echelon of C++ supporters