Re: C++20+
By: hollowone to All on Tue Feb 25 2025 12:58 pm
In my daily and production ready C++ code I consciously got stuck with up to C++17 features that seem to be practical to me.
I think there have been some fairly nice additions to C++ since C++11. I've been doing some C++ development recently, and some things I've found particularly useful are std::thread, shared_ptr, lambda/anonymous functions, and regular expressions.
One thing that bugs me a little is 'auto'. I understand why it was introduced, but I feel like it reduces readability, as we don't immediately know what type the variable will be (or should be) when we see 'auto'.
initialization auto x = {1};
Also, I keep forgetting what the purpose of curly brace initialization is, and I often have to look it up. I see that it does not allow type narrowing, which I do think is useful.
One thing I've seen recently is that for std::vector, they've added an emplace_back() method, which is like push_back(), but they say emplace_back() should have beetter performance as it "creates the object in place".
Nightfox
---
þ Synchronet þ Digital Distortion: digitaldistortionbbs.com