I think using this feature is the wrong advice. Frankly I think much of modern C++ should be rejected. If you want to use a language like with those features then fricken switch language! There are countless better alternatives today: Rust, Swift, D, Haskell etc.

Many are stuck on C++ for legacy reasons. I have worked in such large C++ legacy systems for many years in the past. The average programmer simply cannot deal effectively with this modern C++. It is too complex.

I’ve been down that road being exited about new C++ features only to realize that I’ve actually reduced the productivity of my co-workers.

Often I wonder if C++ programmers all suffer a Stockholm syndrome. They have come to sympathize with their hostage taker C++, making up excuses for the many ways C++ abuse and terrorize them.

I go to these C++ conference talks in occasion and I see people in ecstatic praise about how some genius C++ guru came up with an elaborate convoluted solution to something which is like two lines of code in a sane programming language.

Seriously I think C++ has drained so much of their brainpower that they have simply not been able to look outside and see how the grass is greener everywhere else.

When I use C++ (for personal projects), it tends to be because of the libraries I want to use (eg EnTT[1] or Immer[2], both of which use templates so can't be easily used from other languages). Eventually something like Rust or D may have equivalents to all the libraries I want and I could use those for such projects instead, but for now, if I want to use those things, I need to use C++.

You may also want to look at this talk: "What C++ got Right" [3], where the guy shows some nice things that C++ does that other languages don't. The other languages versions of the code he shows does tend to be simpler and nicer, but the C++ versions tend to give you more control. Some people value that control (rightly or wrongly) and other languages that don't provide it will never feel right to them.

I do personally quite like Rust and I'm eagerly watching Zig and some of the other new contenders, so I'm all for moving to something more pleasant than C++, but modern C++ gives just enough new niceness that I don't feel pushed to jump ship until the alternatives check more boxes.

[1] https://github.com/skypjack/entt

[2] https://github.com/arximboldi/immer

[3] https://www.youtube.com/watch?v=bMSrNBcir4Y&t=1757s

I'm not replying to detract from your point, because I agree with you whole heartedly that competing ecosystems are not mature enough to dethrown C++ if you're someone who is pragmatic and wants to get things done. C++ has an enormous number of high quality libraries with often no equivalents in competing languages.

There are some compelling ECS frameworks emerging in Rust if anyone is interested, though.

Legion -- https://github.com/amethyst/legion

Hecs -- https://github.com/Ralith/hecs

Shipyard -- https://github.com/leudz/shipyard

Specs -- https://github.com/amethyst/specs

Bevy -- https://github.com/bevyengine/bevy -- not strictly comparable as it's an entire game engine, but it's built around an (imo) more ergonomic fork of hecs.

Some benchmarks -- https://github.com/rust-gamedev/ecs_bench_suite