Modernes C++
modernescpp.com · Personal blog · on HN since 2016
Rainer Grimm writes tutorials on modern C++, covering C++20 features, concurrency, the Core Guidelines, and upcoming standards.
What HN saysHN links it as a reference for C++ topics like thread-safe initialization, consteval, and coroutines.
35HN people shared it
14linked it in comments
116stories submitted
905story points
8 months agolast shared
2016people per year2026
Most-shared posts
- 1Reflection in C++263 people · 5 points · first shared 2024 · discussion on HN
- 2C++ 20: The Core Language2 people · 283 points · first shared 2019 · 272 comments on HN
- 3C++20: Concepts, ranges, coroutines, modules2 people · 10 points · first shared 2019 · discussion on HN
- 4A Brief Overview of the PVS-Studio Static Code Analyzer2 people · 6 points · first shared 2019 · discussion on HN
- 5Dynamic and Static Polymorphism2 people · 5 points · first shared 2022 · discussion on HN
- 6Cooperative Interruption of a Thread in C++20: Callbacks2 people · 5 points · first shared 2024 · discussion on HN
- 7C++ Core Guidelines: More Rules to Concurrency and Parallelism2 people · 5 points · first shared 2018 · discussion on HN
- 8Partial Function Application2 people · 4 points · first shared 2023 · discussion on HN
- 9Calendar and Time-Zones in C++20: Time-Zones2 people · 4 points · first shared 2020 · discussion on HN
- 10My Serious Progressive Nerve Condition2 people · 3 points · first shared 2023 · 1 comments on HN
- 11No New New: Raw Pointers Removed from C++2 people · 1 points · first shared 2018 · 1 comments on HN
- 12Multithreading in modern C++1 people · 115 points · first shared 2016 · 39 comments on HN
- 13Latches in C++201 people · 106 points · first shared 2021 · 83 comments on HN
- 14The C++ programmer and educator Rainer Grimm has passed away1 people · 104 points · first shared 2025 · 11 comments on HN
- 15An Improved Thread with C++201 people · 68 points · first shared 2021 · 66 comments on HN
What HN people wrote when they linked it
tradrich · 2022-09-28
How do HFT developers actually achieve single-digit microsecond latency?
Why would you want to bypass the kernel?
Can C++ model semantic categories as elegantly as Haskell?
Can you actually get a job doing this stuff?
We'll cover all this stuff next Tuesday 6pm UK time - that's 1pm US East.
So bring your dinner (or lunch) and come ready with questions for
Antony Peacock: senior developer in low latency trading and technical expert on the ISO C++ committee
Rainer Grimm: Renowned C++ and Python trainer, author and mentor at Modernes C++[1]
Richard Hickling: Trading and risk technology expert and Co-Founder at ProfitView[2]
[1]: https://www.modernescpp.com/
[2]: https://profitview.net/
viraptor · 2018-03-26
Many. I like bashing C++ as much as the next dev, but modern C++ has nice type checks, interesting types/wrappers which help with common patterns (shared, unique ptrs, etc), and the compilers learned some great tricks which allow you to run memory safety checks yourself. (Asan and others)
Also multithreading gets some improvements which will take more of the manual sync details away from the business logic. (http://www.modernescpp.com/index.php/multithreading-in-c-17-and-c-20)
It's still delivered attached to a foot-gun, but you could do worse.
t0mpr1c3 · 2026-03-08
Meyer's implementation (with static block variable) is elegant and thread safe, and retains lazy initialization which can be important for the initialization order. https://www.modernescpp.com/index.php/thread-safe-initialization-of-da…
twic · 2022-12-30
> Are compilers required to evaluate constexpr expressions at compile time, where possible?
No. But C++20 adds consteval, which does carry that requirement:
https://www.modernescpp.com/index.php/c-20-consteval-and-constinit
Well, sort of. It has to produce a constant expression, and in practice the way to do that is to evaluate it at compile-time. But under the as-if rule, a compiler can do what it likes, up to and including producing a binary containing your source code and a copy of gcc, and compiling your entire program when you run it.
jcelerier · 2021-03-10
> Note that C++ offers async as a library and not as a programming language feature which Bjarne Stroustrup is strongly against.
https://www.modernescpp.com/index.php/c-20-coroutines-the-first-overvi…
dasloop · 2020-10-01
A good source of information for what is new in C++ versions: https://www.modernescpp.com/index.php/thebigfour
That article covers the big four new features:
- concepts
- modules
- coroutines
- ranges library
in3d · 2020-09-12
>It seems that C++20's concepts are a viable candidate to compete with rust safety mechanism.
No, that's not really something that concepts do. But there are ways of coding and tools using which you can get closer to Rust's safety features in C++. E.g. https://www.modernescpp.com/index.php/c-core-guidelines-lifetime-safet… or https://clang.llvm.org/docs/ThreadSafetyAnalysis.html.
jacoblambda · 2019-08-31
This was an April Fools joke.
https://www.modernescpp.com/index.php/april-fool-s-joke-raw-pointers-r…
mschuetz · 2018-09-21
> That's just a C# idiom
Not just C#, Python and JS also have it already. And async-await is the first time ever where I've thought that yes, this is a good way to do single-threaded async (event-queue-ish) or even multi-threaded things.
> Check POCO.
Thanks for the hint, I will check it out.
> but somehow you're complaining that C++'s interfaces require programmers to specify where the collections should start and finnish.
Take a look at: http://www.modernescpp.com/index.php/higher-order-functions
The c++ functions are unnecesarely verbose compared to other languages.
This
transform(vec.begin(), vec.end(), vec.begin(),[](int i){
return i*i;
});
could be much more readable as
vec.map([](int i){
return i*i;
});
Also makes for-of the better choice in my opinion because if you're going to write more code, I'd rather write code that is readable.
cesarb · 2018-04-01
Having started using the Internet in the 90's, and thus still remembering Geocities-era websites, I loved that they did this as a webring (https://en.wikipedia.org/wiki/Webring): each blog post has a link to the next one, making a singly-linked circular list.
Starting with this one, we have:
- http://www.bfilipek.com/2018/04/deprecating-pointers.html
- http://www.modernescpp.com/index.php/no-new-new
- https://www.fluentcpp.com/2018/04/01/cpp-will-no-longer-have-pointers/
- https://blog.tartanllama.xyz/no-pointers/
- https://arne-mertz.de/2018/04/raw-pointers-are-gone/
And it circles back to this one.
godelski · 2017-02-06
This might interest you then http://www.modernescpp.com/index.php/the-new-ranges-library
jwilk · 2016-04-28
Apparently you can become famous by proof-reading this guy's articles:
http://www.modernescpp.com/index.php/for-the-proofreaders-and-the-curi…
oO
Certhas · 2016-04-28
That's intentional as it is a translation of a German blog:
> Because the roots of my blogs are in German, I will continue to call him Modernes C++. That is not by mistake.
http://www.modernescpp.com/index.php/warum-einen-blog-zu-modernem-c
Not saying it's a good decision...
lioeters · 2020-03-15
> ..The node_modules package resolution algorithm is how JS does namespaces.. I wonder whether they got that right through sheer genius, or by accident.
I recall hearing Ryan Dahl's regrets about design decisions in Node.js, a few of which had to do with the module/package resolution algorithm.
10 Things I Regret about Node.js - https://www.youtube.com/watch?v=M3BM9TB-8yA
There are some good aspects of it though. I like how modules/packages are just imported objects (the path resolution is a bit weird and seemingly inefficient, i.e., checking every parent folder's node_modules folder). It goes together well, that modules are also self-contained function scopes by default (I suppose a kind of anonymous namespace), that exports a plain object with assigned properties.
---
Wow, I just learned about C++20 Modules, looks like a game-changing feature.
https://modernescpp.com/index.php/c-20-modules