r/programming • u/jlpcsl • Sep 24 '20
New C++ features in GCC 10
https://developers.redhat.com/blog/2020/09/24/new-c-features-in-gcc-10/7
u/Wind_Lizard Sep 24 '20
Hopefully I will be able to use this in 2030 at least. Currently stuck with gcc 4.4 :(
3
u/theMonoid Sep 25 '20
I actually make my company(a top 10 tech company in China )upgrade from gcc 4.8 to gcc10 in a year recently, yes, that’s the most exciting job I have done in my whole career
1
u/Wind_Lizard Sep 25 '20
Good job! I am counting days until EOL of RHEL6 end of this year so we can finally move to 4.8.5. That was the best I could convince my boss on :(
2
u/theMonoid Sep 28 '20
Actually we are currently using the CentOS6, and two years ago CentOS 4 was everywhere. Keep tens of thousands of servers up to date is an impossible task, so we take another way: we build our own tool-chain including kernel/glibc/binutils/gcc/clang etc, make the tool-chain self contained and deploy it on every server, that's why we can have clang10/gcc10 on CentOS 4 and CentOS 6, that's not a perfect solution, still it make us benefit from the latest C++ standard.
2
-3
u/Puzzleheaded-Wolf-37 Sep 24 '20
C++ became more and more complex :(
7
u/salvoilmiosi Sep 24 '20
you are not obliged to use all of the features :)
2
u/DowsingSpoon Sep 25 '20
No, but you are obliged to understand all of them, and their interactions...
2
u/Hacnar Sep 25 '20
No, there are many arcane c++ constructs that I don't use or understand, and I have yet to see this being a problem or a source of a bug.
1
u/Vowek Sep 25 '20
If you work in project with many people these people will use different part of C++ and you need to understand these parts. Ergo In projects comprising of more than one person you need to know a lot more than you use.
5
u/Hacnar Sep 25 '20
I've been working on a project with over 1 million LoC in C++, with several other people, for over 5 years. Anytime you work with multiple people, you need to understand their code. That doesn't mean you need to know the whole language, otherwise everyone would know the whole language they use.
3
u/serviscope_minor Sep 25 '20
I disagree. The various features in C++ are there to tackle various problems. If you don't have that sort of problem then you shouldn't be seeing that feature used.
There's also a difference between using code written with those features and writing those features. The codebase I'm working on makes fairly heavy use of Eigen in places. Few people are really up to speed enough on old fashioned style heavy template meta programming to understand the implementation of Eigen in detail. The numerics people certainly don't on the whole but they can write good quality numerics code to calculate complicated things. Many of the pure software engineers don't either (or are so rusty as to be the same), but we don't go digging into the Eigen code anyway, since it's well maintained externally and we're just not in the situation where we're fighting bugs in that library. Some of the senior people can, but there's not the need.
So you could say we're using lots of arcane template metaprogramming, and we are in one sense, but we're not writing that metaprogramming. And it would be a worse language if a library like Eigen could not exist.
2
u/serviscope_minor Sep 25 '20
C++ became more and more complex :(
Really? What about the current behaviour of a[b,c] is intuitive, and how does deprecating it make C++ more complex?
Likewise initialisers for structs, how is making the language more regular making it more complex? If anything removing special cases (lol emplace doesn't work with structs lol) makes it simpler not more complex.
2
35
u/nandryshak Sep 24 '20
C++ is actually a pretty nice language. It has a lot of nice features, it's fast, popular, lots of libraries, great tooling, cross-platform GUIs. Despite being a bit ugly, if they sped up compile times and put in good error messages instead of incomprehensible gibberish it'd be a fantastic language (provided you use smart pointers and other more modern features).