New C++ Features Voted In By C++17 Standards Committee (reddit.com)
New submitter lefticus writes: The upcoming C++17 standard has reached Committee Draft stage, having been voted on in the standards committee meeting in Oulu, Finland this Saturday. This makes C++17 now feature complete, with many new interesting features such as if initializers and structured bindings having been voted in at this meeting.
An [audio] interview with the C++ committee chair, Herb Sutter, about the status of C++17 has also been posted.
An [audio] interview with the C++ committee chair, Herb Sutter, about the status of C++17 has also been posted.
C++ needed more features. Some C++ books aren't even 1000 pages long.
I look back fondly at "c with objects". At least I could decipher the error messages.
Still no functional gonkulators. Still no encabulation templates. Still no dichroic monads or parameterized gussets. When will the C++ committee ever get around to adding modern language features that users actually want?
I appreciate the idea behind if initializer. This is actually a somewhat common pattern.
if (MyClass *p = getMyClassOrNull() {
p->doYourThing();
}
But I fear using initializer statements easily gets too long for a line, and couldn't it already be done with the comma operator?
Unfortunately the most important features weren't added. Concepts, modules, reflection and concurrency ... those would actually fixed almost all the things, where c++ is lacking now. Hope those will get into the next standard at least.
There's still no std::string split() method.
Open closures, interior decorators, and conditional consts. In protest I'm gong back to c++--
Where are we going and why are we in a handbasket?
use rust = Use Rust.
Its simpler safer and its better = It's simpler, safer, and better.
You wrote two lines. With 8 errors. Is four errors per line about average for Rust programmers?
What are you trying to say? That they should rush in features that haven't been thought through? That they should put half-arsed or broken features in place just to say that they have? That they should then support these broken features for decades, since that's how long C++ projects tend to live?
Look, if you want a language with buzzword features thrown in left and right, with changes to these features happening just about every release, then maybe a programming language like Rust is what you're looking for. C++, on the other hand, is a language meant for professionals to use when developing complex systems that won't just be used next week, but will be used 15 or 20 years from now, assuming they aren't still being used long after that. Those standardizing C++ have a huge responsibility on their shoulders. They can't goof around with C++. If a change is made to the language, it has to be thought out thoroughly and it has to be the right thing to do.
I'm not that impressed with the "if statement with initializer" addition and especially not impressed with one of their examples that use it to make things more compact. I don't like declaring the same variable twice and think more traditional coding would actually be cleaner.
status_code foo() {
int n = get_value();
if (status_code c = bar(n); c != status_code::SUCCESS) { return c; }
if (status_code c = do_more_stuff(); c != status_code::SUCCESS) { return c; }
return status_code::SUCCESS;
}
Seems like a pretty pointless addition.
It must have been something you assimilated. . . .
Is that what they told you in MBA school? Funny enough, it's managed code such as PHP, JavaScript and managed code runtimes such as Flash (for ActionScript) which have brought on the vast majority of security flaws on the InterNet.
All you need to know about C++17 is here: https://www.youtube.com/watch?...
I started programming in C++ in '89. Templates were still new, but most of the language was stable. C++ code I wrote in '89 is still readable and compilable today. I know people who started with C++ in 1981, when it was still Bjarne's skunkworks project. The first public release was '83, making C++ 33 years old -- closer to 40 years old than 25.