News for hackers. Stuff that matters.
Re:Why the C++ standard ships every three years by Rexxar on Saturday July 13, 2019 @02:27PM (#20429425)
The 1998-2011 gap has made a lot of damage to c++ in term of "market share". I think it's necessary to avoid something similar happen again.
Re:Why the C++ standard ships every three years by asveikau on Saturday July 13, 2019 @03:11PM (#20429633)
I kind of see it differently, that the 98 and 03 standards had a lot of mileage and as necessary as the more recent changes may have been, people felt the old standard pretty usable for a long time.

C++11 was a really big shakeup. In contrast, C11 isn't a major difference over C99. Sometimes I read about the rapidly evolving modern C++ and I wonder if they are moving too fast, as large chunks of the community have not even caught up with what is already there.

Re:Why the C++ standard ships every three years by fredophile on Saturday July 13, 2019 @06:06PM (#20430458)
I think it's worth noting that up until 2010 C++11 was known as C++0x. Everyone knew it was coming. You could get a good idea of what it was going to contain by looking at things like Boost. C++03 wasn't some abnormally stable version, it just took a longer than expected time to write the standard for C++11.
Re:Why the C++ standard ships every three years by asveikau on Saturday July 13, 2019 @06:45PM (#20430618)
Yes I remember. Also, by the time c++0x seemed "right around the corner" for several years, a lot of the library features like smart pointers were already common practice, the standard just, well, standardized them.

It was possible and common to have pretty "modern" styles in c++03, you'd just have to do without lamdbas etc. and be using less of the 'std' namespace.

Re:Why the C++ standard ships every three years by humanrebar on Saturday July 13, 2019 @09:58PM (#20431205)
Strong disagree.

The nonsense needed for "variadic" templates in C++03 isn't "just do without lambdas". You basically have to walk on eggshells to get the equivalent of unique_ptr. Not having to type std::vector<SomeTypeName, WhateverBuffer>::const_iterator changes the way you write code, too.

The stronger guarantees on copy elision lets you skip return by reference nonsense more aggressively.

Re:Why the C++ standard ships every three years by pingyong on Wednesday July 17, 2019 @09:57AM (#20459530)
> Sometimes I read about the rapidly evolving modern C++ and I wonder if they are moving too fast

Sure there are a lot of small accumulating changes, but they can easily be caught up on by reading the documentation when you actually need those features.

On the other hand, I've been waiting for modules, concepts and networking literally since 2012 - and I only started using C++ in 2011, with around 2 years of experience in C. I don't think anyone is moving too fast in that direction.

Edit: I still remember the graphic from the committee/Herb, which showed 2014 for the networking TS, and 2017 for concepts/modules. The "networking TS" then ended up being like one .pdf file with functions for LE/BE conversion, and well obviously concepts and modules aren't in C++17. (Neither is any actual networking.) And while concepts look to be on a fairly good path for C++20, I'm going to be very surprised (and happy) if they'd manage to get modules in, too.

Re:Why the C++ standard ships every three years by gurkendoktor on Saturday July 13, 2019 @04:09PM (#20429898)
This was also the timeframe in which boost::shared_ptr, boost::filesystem, boost::variant, and boost::thread have matured to the point where they could be imported into the standard, and when people discovered all these dark corners like SFINAE. The C++ language was frozen, but the C++ ecosystem never really stopped moving.

I actually think that the lack of a popular cross-platform package manager is much more harmful. It's amazing what GitHub and CocoaPods did to the niche Objective-C community in such a short time, while C++ still isn't a language where people celebrate cool open source libraries.

Re:Why the C++ standard ships every three years by prewett on Saturday July 13, 2019 @05:50PM (#20430378)
Maybe this is my old skool C++ bias, but every time I’ve inherited a project using CocoaPods I’ve found the code to be of poor quality and the Pods to be either corporate libraries (third-party analytics, crash logs, etc.) or wrapper code of questionable quality that hasn’t really provided any benefits over a couple of hours of writing some simpler code yourself.

And you yourself mentioned Boost, which is kind a code ecosystem of its own, all open source. But I think C++ has problems with libraries because it’s such a pain to add a library to C++. If the library is C++, you can’t ship a binary and header file like with a C library because the ABI needs to match, so you have to compile the thing. And then people like Boost do template wizardry that consumes compile time to produce magic, but some developers value the compilation speed over magic, so they don’t use anything heavily templated. But if it isn’t templated, it likely could be written in C if it isn’t a big UI framework, and be available for everyone. So, no C++ library ecosystem.

Re:Why the C++ standard ships every three years by imtringued on Sunday July 14, 2019 @07:35AM (#20432895)
Boost is awful even if you don't instantiate any templates. Just adding #include <boost/filesystem.hpp> will add 1 second to compile that compilation unit and we haven't even done anything with it.
Re:Why the C++ standard ships every three years by gurkendoktor on Sunday July 14, 2019 @01:25AM (#20431809)
Swift had the same ABI issues as C++, but when most packages ship as source code, it's not that big of an problem. This is precisely the thing that a standardized package manager can establish.

I think it's a bit of a catch-22. C++ projects are so rare and monolithic that reinventing the wheel every now and then. But maybe more (smaller) projects would happen in C++ if there were polished libraries for reasonably common requirements like sending a SOAP request.

Re:Why the C++ standard ships every three years by gumby on Sunday July 14, 2019 @09:31AM (#20433257)
> Swift had the same ABI issues as C++, but when most packages ship as source code, it's not that big of an problem

... and when there's essentially a single build system for Swift code. While for C++ there are several.

Re:Why the C++ standard ships every three years by pjmlp on Monday July 15, 2019 @12:06PM (#20442111)
Having a single master, instead of having to please every compiler vendor, helps.
Re:Why the C++ standard ships every three years by gurkendoktor on Sunday July 14, 2019 @12:07PM (#20434165)
Over-edited my comment, should have been:

> C++ projects are so rare and monolithic that reinventing the wheel every now and then...

...does not hurt much.

Re:Why the C++ standard ships every three years by amrox on Saturday July 13, 2019 @05:56PM (#20430415)
I would say that the primary driver for growing the niche Objective-C community was iOS, not CocoaPods. And Objective-C is dying again with the introduction of Swift.

Also, I see cool C++ open-source projects being released fairly frequently.

Re:Why the C++ standard ships every three years by pjmlp on Monday July 15, 2019 @12:11PM (#20442178)
My graduation project was to port a the particle visualisation framework of my supervisor from Objective-C/Renderman into Visual C++/Window/OpenGL, because he saw no future in it, little did he know what would happen 10 years later.
Re:Why the C++ standard ships every three years by bogwog on Saturday July 13, 2019 @02:31PM (#20429441)
Alternatively, releasing new features every 3 years to an already-bloated language could cause even worse damage.
Re:Why the C++ standard ships every three years by jb1991 on Saturday July 13, 2019 @02:41PM (#20429497)
This suggests you aren't aware of the many huge benefits that have come from introducing modern features that other languages have. C++ since 2011 is quite a different language to what it was before, and this is hardly a bad thing. So many of the challenges of writing C++ were significantly simplified with the introduction of lambdas, smart pointers, and threading primitives.
Re:Why the C++ standard ships every three years by arcticbull on Saturday July 13, 2019 @02:41PM (#20429499)
The issue isn't that it gets new features it's that they're half-assed because you can't impose new restrictions on old code. The power of these features in modern languages comes from their ability to protect you from yourself. That has more to do with what you can't do than what you can. Bolting more legs onto C++ doesn't protect you from anything, it just increases the surface area of the language.

They haven't introduced the features other language have, they've introduced poor rip-offs that fail to work as one might expect having worked in any of the other languages they're derived from.

The problem is it's not different than it used to be, the cracked foundations are exactly the same as they've always been always been but there's a bigger and more complicated house on them. C++ is starting to feel like the Winchester mystery house.

Re:Why the C++ standard ships every three years by jdsully on Saturday July 13, 2019 @02:49PM (#20429531)
The C++ philosophy is not about protecting you from yourself. Its about allowing you to express your idea in as low or high level terms as you require. This lets you write a highly optimized tight loop and then abstractly describe less performance sensitive parts.

In the past it was thought that people would use safer high level languages and then drop down to C for performance. That vision just doesn’t seem to work out in practice - except at the cross process level.

The trade off to this is language complexity. If you want a simple language C++ isn’t for you - and that’s OK.

Re:Why the C++ standard ships every three years by hawski on Saturday July 13, 2019 @03:19PM (#20429678)
C++ for me was and with every newer standard is really a meta language. It is used by many big projects to build their own "language". Such a language is almost completely ad-hoc and does not enjoy compiler checks, because it lives in project guidelines. It may enjoy some checks thanks to whole template machinery. But error messages barf about templates not a real intention behind them.

Every big project is almost entirely different. They use different sets of features - some overlap more, some less. Many developers like to use C libraries, because they are easy to wrap in their version of C++. When you shop for libraries you often have to think if their version of C++ will work with yours. There is some consensus around STL and Boost, so at least that is relatively straightforward.

Re:Why the C++ standard ships every three years by jdsully on Saturday July 13, 2019 @03:37PM (#20429759)
There seems to be a more modern trend of wanting all code to look the same. I've worked in large projects that have existed over many eras (including as far back as K&R C). The "Refactor when it becomes a problem" seems to work amazingly well. Global refactors and project wide styles seem to always fail miserably - inevitably a new era comes before the previous standardization effort completes.

E.g. in the C->C++ transition most malloc's were left alone. If you wanted to add a ctor/dtor then you would go refactor them as necessary. It also encouraged you to encapsulate your work moreso than you would have otherwise.

Re:Why the C++ standard ships every three years by 0815test on Saturday July 13, 2019 @03:46PM (#20429789)
"Global refactors" work well with type system support, and not at all otherwise - and more modern languages do tend to come with better such support. Even for C++ itself, LLVM has a few bespoke tools to help you refactor old code as suggested by the semi-official C++ Core Guidelines - of course not all possible "refactors" are equally supported!
Re:Why the C++ standard ships every three years by roca on Saturday July 13, 2019 @05:55PM (#20430410)
A project where different modules are written in different C++ dialects is a real pain when you have to refactor code across modules or even just write or review code in different modules. And the finer the granularity at which you allow dialects to be mixed (within a module, within a file, within a function), the more horrible it gets. Every time you make a change you need to think "what dialect am I supposed to be using here?" The mental surface area required to understand code grows and grows.

But it is also true that forcing all the code in a project to use a single dialect is expensive. Developers need to decide what that dialect is --- not just once, but constantly as C++ evolves. ("Is it time to use Ranges yet? Concepts?" etc.) You need to do expensive refactors every time you update the dialect. You need to enforce the dialect at code review time (harder as it changes). Every time you import third-party code into the project you need to update its dialect.

A constantly evolving language that regularly deprecates commonly-used features in favour of "better" alternatives, like C++ does, is problematic. The faster pace of C++ evolution is making this problem worse.

Re:Why the C++ standard ships every three years by jdsully on Saturday July 13, 2019 @06:14PM (#20430496)
Which features are painful?

Aside from exceptions (Can't use them safely if RAII is not universal) and shared pointers, most new language features are pretty localized in effect. E.g. using a lambda in a function originally written in C++98 does not make the existing code less safe. Only your sense of aesthetics would force you to update the rest of it.

Re:Why the C++ standard ships every three years by saagarjha on Saturday July 13, 2019 @08:07PM (#20430883)
> E.g. using a lambda in a function originally written in C++98 does not make the existing code less safe.

You may not be able to if the lambda captures state and you need to convert it to a function pointer.

Re:Why the C++ standard ships every three years by marcosdumay on Saturday July 13, 2019 @02:53PM (#20429553)
> That vision just doesn’t seem to work out in practice

Well, about half of the Python ecosystem seems to disagree.

Re:Why the C++ standard ships every three years by jdsully on Saturday July 13, 2019 @03:13PM (#20429644)
Python is likely the best example of this working, however even in Python the boundaries between high and low performance sections are very formal. It's a lot simpler to go in and optimize a piece of code the profiler has pointed out with C++.

I really don't understand the animosity non-C++ developers have towards the language. You can still use Python, Rust, etc if you want. Nobody wants to force you to use C++.

Re:Why the C++ standard ships every three years by hawski on Saturday July 13, 2019 @03:23PM (#20429697)
I am a C++ developer by career. Me and many other C++ developers I know do not really like the language. It is what it is. It has useful parts, but complexity is a weight.
Re:Why the C++ standard ships every three years by clappski on Sunday July 14, 2019 @03:48AM (#20432273)
How do you end up being a C++ developer that hates the language? I’m a C++ developer as well, and if I ever decided that’s I didn’t like what I was doing every day I’d learn a different language and try to get hired for that.
Re:Why the C++ standard ships every three years by arcticbull on Sunday July 14, 2019 @10:32AM (#20433597)
I’ve been an iOS engineer for 7 years and I’m not exactly a fan of Objective-C. I’m good at it though, I know where all the sore spots are and part of my value is I can stop people from hurting themselves with the language. One day, inshallah, our team can eventually move on to swift (thank you ABI compatibility).

Until then I work in it because my goal (and my job) is to deliver amazing products and experiences to my customers and if I had to do that in COBOL, I’d do that too. My job is not about the language for me, it’s about what I’m doing with it.

Re:Why the C++ standard ships every three years by marcosdumay on Saturday July 13, 2019 @04:40PM (#20430013)
Non-C++ developers are usually awed by it. The animosity comes from people with experience in C++ that decided not to use it.

Pre-11 C++ was a bad language. The gains of leaving it to something like Java (that isn't even good by today's standards) were huge. The new standards are making it possible to create better code on the language, but it is still far from a modern language and the added features can not remove complexity, they can just add to it.

Re:Why the C++ standard ships every three years by jb1991 on Saturday July 13, 2019 @04:51PM (#20430074)
> the added features can not remove complexity, they can just add to it

There are countless examples of the so-called modern C++ features reducing complexity in code.

For example, it is now considered a code smell to ever write "new" or "delete" in your code. Imagine that, never using these words to manually allocate and delete memory in C++! But it's true, unique_ptr in particular makes so much simpler and safer.

Type inference with auto doesn't just save typing, it improves performance in many cases and reduces a lot of complexity, while also avoiding uninitialized variables.

These are just a few of at least a dozen examples that come to mind about reducing code complexity with more modern C++ features.

Re:Why the C++ standard ships every three years by roca on Saturday July 13, 2019 @05:41PM (#20430347)
New features can reduce the complexity of code, but they cannot reduce the complexity of the language.

C++ programmers still need to know what "new" and "delete" do, so they can work with older code that uses them. They also need to learn what "auto" does, so they can work with newer code that uses it. (The behavior of "auto" isn't trivial; how many C++ programmers understand the difference between "auto v = <expr>;" and "decltype(<expr>) v = <expr>;"?)

Re:Why the C++ standard ships every three years by shaklee3 on Saturday July 13, 2019 @07:19PM (#20430734)
Why would you ever use or see the latter? Fabricated examples aren't helpful.
Re:Why the C++ standard ships every three years by comex on Sunday July 14, 2019 @02:43AM (#20432038)
You wouldn't...

...instead you'd use "decltype(auto) v = <expr>", which is equivalent. And people certainly use decltype(auto), or else it wouldn't have been added to the language, 3 years after regular auto.

Re:Why the C++ standard ships every three years by saagarjha on Saturday July 13, 2019 @08:09PM (#20430890)
Not sure why this was downvoted, decltype was introduced with C++11 alongside of auto for declarations: the example given isn't accurate of reality. A better one might be a function returning auto vs returning decltype(some expression).
Re:Why the C++ standard ships every three years by detaro on Saturday July 13, 2019 @08:21PM (#20430926)
Which specific example is choosen doesn't seem all that relevant for the point of "there's these two similar but not identical things people have to/might not understand the difference of"
Re:Why the C++ standard ships every three years by saagarjha on Saturday July 13, 2019 @08:28PM (#20430945)
Picking an example that never occurs is not relevant, because nobody needs to learn the thing that never comes up in practice.
Re:Why the C++ standard ships every three years by detaro on Saturday July 13, 2019 @08:36PM (#20430964)
But as you show with your other example, the difference between auto and decltype does come up in practice, even if the example is not a typical one.
Re:Why the C++ standard ships every three years by saagarjha on Saturday July 13, 2019 @08:40PM (#20430978)
Sure: that's why I provided one that reflected the real world more closely.
Re:Why the C++ standard ships every three years by detaro on Saturday July 13, 2019 @08:43PM (#20430982)
re-reading: My first comment was addressing the "why might this have been downvoted part", I didn't make that clear enough.
Re:Why the C++ standard ships every three years by prewett on Saturday July 13, 2019 @05:39PM (#20430336)
I hate unique_ptr and shared_ptr, using them is so glaringly inconsistent. Half the time you can’t construct a unique_ptr when it’s easy, because you don’t have the information until just enough later (like after a calculation or two in the body of your constructor) that you can’t use the easy way. So how do you transfer a unique_ptr? Well, the obvious ways don’t compile, and you eventually learn you have to move it, which involves using std::move(), but it always seems to go in the place I don’t expect it. And then how do you use a unique_ptr outside of your class? You can’t pass by value, for obvious reasons. Pass by reference, maybe? I think that’s frowned upon, I think you’re supposed to pass a naked pointer, and Modern C++ code is supposed to understand that naked pointers mean I’m loaning you this pointer. But I thought the point of Modern C++ was to get rid of pointers? Anyway, shared_ptr works completely the opposite way. You are supposed to pass the pointer by value. Now you can argue that of course it’s supposed to be that way, and the arguments are all cogent and when you spend half a day figuring it all out it makes sense. Until tomorrow when you forget it all and have to actually use the things. Plus I hate underscores with a passion, it hurts to type them. Modern C++ also seems to like making a line of code longer and longer, because you can’t just make a unique_ptr or shared_ptr with a constructor, no, you need make_unique<typename>(...), and the arguments are magically the same as the type’s constructor, even though it’s obviously a different function. Yuck! At least new and delete are pretty obvious how to use, and only have one special case to worry about ([]). Granted, the *_ptr are better, but I hate using them and wish I could use something that was shorter and easier to remember.
Re:Why the C++ standard ships every three years by saagarjha on Saturday July 13, 2019 @08:17PM (#20430913)
> I hate unique_ptr and shared_ptr, using them is so glaringly inconsistent.'

They're glaringly inconsistent because they behave differently with regards to ownership, and the fact that you can't copy them or pass them around in certain cases is because they're designed to stop you from doing this as it would undermine the reason you're using the class.

Re:Why the C++ standard ships every three years by prewett on Wednesday July 17, 2019 @06:25PM (#20464661)
Yes, but that fact is I can't ever remember how to use them properly (unique_ptr in particular). It's not often that you need to pass a unique_ptr to a function outside your class so that it can do something with it (without transferring ownership), so I can never remember how I'm supposed to do it. But it seems like if I want to hand a pointer to a short-lived function, doing it ought to be pretty consistent, whether I'm passing an old-skool naked pointer, a unique_ptr, or a shared_ptr, and it's not.

Like I said, if you look at all the logic, there's a good reason why everything is the way it is. The problem is I can't use the things without looking them up. Usability of my language is a big deal for me, which is why I hate unique_ptr.

Re:Why the C++ standard ships every three years by TFortunato on Saturday July 13, 2019 @07:53PM (#20430844)
FYI, you can use a constructor with a shared/unique ptr.

auto p = unique_ptr<Foo>(new Foo());

Totally works, and may be easier to remember if you dont like the "magic" parameter forwarding.

Re:Why the C++ standard ships every three years by jdsully on Saturday July 13, 2019 @08:35PM (#20430960)
Careful with that if it's not the only thing happening in the statement. It might be a while between the 'new' and the unique_ptr ctor. If an exception happens in between the object will leak.

e.g. foo(unique_ptr<X>(new X), unique_ptr<Y>(new Y)) is a leak waiting to happen.

https://stackoverflow.com/questions/37514509/advantages-of-u...

Re:Why the C++ standard ships every three years by nemanjaboric on Sunday July 14, 2019 @04:30PM (#20435788)
Re:Why the C++ standard ships every three years by TFortunato on Saturday July 13, 2019 @09:18PM (#20431097)
Very good point! I was only thinking about the specific case of a statement that just makes an object and shoves it into a unique_ptr (e.g. does what make_unique does in the linked Herb Sutter article), in response to the comment about not being able too use a normal constructor. You are totally right that this isn't exception safe in cases like you mentioned.
Re:Why the C++ standard ships every three years by edflsafoiewq on Saturday July 13, 2019 @06:04PM (#20430449)
The vast majority of the time you just want to pass a reference to the pointed-to object (for both unique_ptr and shared_ptr). Once you've decided what you're actually going to do with the object, that usually determines how you're going to want to pass it.
Re:Why the C++ standard ships every three years by jcelerier on Sunday July 14, 2019 @05:13AM (#20432512)
> But I thought the point of Modern C++ was to get rid of pointers?

no it's not, it never has been. The point of modern C++ is to get rid of owning pointers.

Re:Why the C++ standard ships every three years by voldacar on Sunday July 14, 2019 @12:56AM (#20431710)
How does auto improve performance? Doesn't it just expand to whatever type a human would have manually had to put there in the first place?
Re:Why the C++ standard ships every three years by AstralStorm on Sunday July 14, 2019 @02:36AM (#20432011)
It allows automatic generic specialization in some cases by the compiler, as you don't have to do template-fu or use a nonspecific type or manually write multiple specializations.

Plus it usually makes the code cleaner by focusing on structure not types. As any construct, it can of course be abused.

Re:Why the C++ standard ships every three years by fredophile on Saturday July 13, 2019 @06:15PM (#20430499)
I disagree that pre-11 C++ was bad. It would be bad now to make a new language that looked like pre-11 C++ but there is a reason it was so popular.
Re:Why the C++ standard ships every three years by jdsully on Saturday July 13, 2019 @10:14PM (#20431259)
Its a bit like IE6. A big upgrade over C but the next update took so long that it was hated at the end of its life. Which coincidentally is exactly why C++ now does timed releases.
Re:Why the C++ standard ships every three years by jefftk on Saturday July 13, 2019 @05:34PM (#20430307)
I worked full-time in C++ from 2012 to 2017, and I don't like the language. I also did feel like I had to use it: I was a developer on an Apache/Nginx webserver plugin, and since those are written in C our choices were (1) C, (2) C++, or (3) a C shim that communicates with some other language. None of these options were ideal, but of them (2) was our best one.
Re:Why the C++ standard ships every three years by hellofunk on Saturday July 13, 2019 @04:45PM (#20430039)
> they've introduced poor rip-offs that fail to work

This sounds like hyperbole to me. I've worked in other functional languages professionally for many years, but when I write C++ with consistent use of std::function and lambdas, I get many of the same benefits and a very enjoyable workflow. Is it the same as Haskell or Clojure? No, because they are totally different languages. But within the C++ world, they offer a great productivity benefit that I don't think satisifies the definition of "rip off".

Re:Why the C++ standard ships every three years by arcticbull on Saturday July 13, 2019 @05:27PM (#20430266)
Not all of them, to be sure, lambdas and in particular their capture list syntax is solid. By no means is that universal though, for instance, move semantics.

std::move doesn't move anything, it casts an object as a movable reference (equivalent to static_cast<T&&>). The compiler doesn't preclude you from accessing the old object (or say anything at all) and there's no guarantee it actually did get moved, it's just a hint. That's not real move semantics, it's a shoddy knock-off.

You also have to manage a new constructor, new reference type and the opt-in because the default remains not using move semantics. Worse yet, there's varying agreement on what you can or should do with the source of a moved value, the STL containers will all continue to let you use the old value, it's just empty now. That's not standard behavior because there is none, and it's de facto now because it's in the STL. What a nightmare. [1]

std::variant is supposed to be associated values on enums, but of course, it doesn't do that either. You don't match, you create a new struct with a bunch of operator() methods on it [or overload a lambda?!] and throw it at std::visit. You can only have one variant of each type. Then it throws exceptions if you start mucking about in ways you shouldn't. There's no context. It's dreadful. [2]

[1] http://yacoder.guru/blog/2015/03/14/cpp-curiosities-std-move...

[2] https://www.bfilipek.com/2018/06/variant.html

Re:Why the C++ standard ships every three years by Negitivefrags on Saturday July 13, 2019 @06:45PM (#20430615)
I think the way you are thinking about move is all wrong.

In any kind of correct code, the difference between a move and a copy is only performance. If a copy were to happen where a move was requested then the code is just as correct, so I find it strange to get so hung up on it not being “real”.

Also, if move is the only available option, and move cant happen, you get a compiler error. If performance is correctness for a type that is expensive to copy, make copy not an option.

Also, there is a move constructor by default so it’s not opt-in, you opt out only if you start screwing around with copy / assignment / destructors which you usually shouldn’t need in modern code anyway.

Sure, the state of moving on the moved from object is unspecified, but really, I can’t think of a time when I’ve written code that would care. It’s kind of a non-problem.

If you really want to reuse an object after a move I question your motives, but you should just reinitilaise it by assigning a freshly constructed value and the result of that is of course standard.

Re:Why the C++ standard ships every three years by tsimionescu on Sunday July 14, 2019 @02:57AM (#20432093)
> In any kind of correct code, the difference between a move and a copy is only performance. If a copy were to happen where a move was requested then the code is just as correct, so I find it strange to get so hung up on it not being “real”.

That's just not true when you take smart pointers into account. unique_ptr is pretty obvious, since it can't be copied. But shared_ptr is more devious, as there is a clear semantic difference between giving someone a copy of your shared_ptr vs moving your copy to them. And, given that destructors are often used for more than simple resource cleanup (e.g. they are sometimes used for releasing locks), the difference between a move and a copy can have a huge impact on program behavior.

Re:Why the C++ standard ships every three years by roca on Saturday July 13, 2019 @05:59PM (#20430431)
Lambda captures make it pretty easy to create nasty memory safety issues via dangling references. Sure, you could create such issues with the equivalent manually written closure-structs, but lambda captures pave the dangerous path.
Re:Why the C++ standard ships every three years by pfultz2 on Saturday July 13, 2019 @08:36PM (#20430962)
But cppcheck can find a lot of dangling references with lambda captures.
Re:Why the C++ standard ships every three years by hellofunk on Saturday July 13, 2019 @06:14PM (#20430493)
I would consider your counter examples rather compelling, thanks for the details. I never particularly enjoyed move semantics, so you have a point there.
Re:Why the C++ standard ships every three years by MauranKilom on Sunday July 14, 2019 @10:10AM (#20433465)
There is still quite a bit of friction at the seams to the "core" language though. If you write a plain templated function, you have to wrap it in a lambda (or some other functor type, or std::function I guess) before you can do anything with it except calling it. Pattern matching is also quite verbose currently.

Whether this matters really depends on the code you're trying to write of course.

Re:Why the C++ standard ships every three years by AnimalMuppet on Saturday July 13, 2019 @03:01PM (#20429583)
The fact that you can't make old code use the new features in no way makes the new features "half-assed". It may make the old code that, but not the features.

Or did you want them to deprecate large swathes of the previous standard?

As for the rest of your rant... it's mostly just a rant, with very little substance.

Re:Why the C++ standard ships every three years by rrss on Saturday July 13, 2019 @02:43PM (#20429505)
Those are all C++11 features, right? So they aren't much of an argument in favor of 14, 17, 20.
Re:Why the C++ standard ships every three years by MauranKilom on Sunday July 14, 2019 @09:59AM (#20433407)
We also got Class Template Argument Deduction, structured bindings, various syntactic sugar (if (auto var = initializer) {}, if constexpr, fold expressions...), std::variant, std::optional, and a whole POSIX-style filesystem library, to name a few. And that's just C++17 alone.

It's nothing earth-shattering (that stuff is coming in C++20) but these are all features that improve the language and allow you to write better code. Consider e.g. if constexpr which can eliminate so much SFINAE cruft. Or CTAD to reduce the need for makeXYZ() functions.

Re:Why the C++ standard ships every three years by blub on Saturday July 13, 2019 @03:14PM (#20429650)
14, 17 and 20 are full of small and big improvements: coroutines, contracts, modules, concepts, huge improvements for compile-time computation with constexpr, etc.
Re:Why the C++ standard ships every three years by hellofunk on Saturday July 13, 2019 @04:42PM (#20430028)
As an example, yes. Other versions offered similar benefits (C++14 in particular was a "bug fix" version for C++11, which I think most would be happy came quickly).
Re:Why the C++ standard ships every three years by arcticbull on Saturday July 13, 2019 @02:40PM (#20429492)
This. They keep adding half-finished features apparently for the sake of releasing every 3 years. Move types that may not move (std::move is just a cast / suggestion that if taken leaves the receiver in an indeterminate, useable state), pattern matching that isn't (std::variant). Frankly, I wish they'd stop.
Re:Why the C++ standard ships every three years by 0815test on Saturday July 13, 2019 @02:34PM (#20429461)
> The 1998-2011 gap has made a lot of damage to c++ in term of "market share".

Not really... Rust 1.0 is from mid-2015, well past 2011.

Re:Why the C++ standard ships every three years by zone411 on Saturday July 13, 2019 @09:12PM (#20431077)
Not saying Rust is bad by any means, but it has about 20 times smaller market share than C++ according https://www.tiobe.com/tiobe-index/ and 11 times smaller according to http://pypl.github.io/PYPL.html.
Re:Why the C++ standard ships every three years by tdsamardzhiev on Sunday July 14, 2019 @12:26AM (#20431632)
Tiobe and PYPL are not market share indices, they're googling indices. I'd be very surprised if Rust really has 1/20 of C++'s market share as in number of companies and programmers that use it.
Re:Why the C++ standard ships every three years by zone411 on Sunday July 14, 2019 @01:47AM (#20431876)
True, they are not great indices. Indeed.com shows me around 40 times more job openings for C++ and StackOverflow shows 14 times more C++ questions this year. Github shows 12 times more commits in C++ this year. None of these are great by themselves but a guess of around 20x seems reasonable.
Re:Why the C++ standard ships every three years by AsyncAwait on Sunday July 14, 2019 @06:59AM (#20432801)
Rust only reached 1.0 status in 2015, keep that in mind.