> It's hard to imagine that the feature would require 56 (!!) pages of specifications if the constness rule were omitted. Who the heck ordered that!!??
The better question you should ask is: who determined that number and put it in their paper with a straight face?
Yes, the section on wording in P2900 is physically 56 pages. That's not 56 pages of new wording though.
For those unaware: Wording is always presented as a diff to the working draft. Apart from new sections that have to be added for contracts, those 56 pages replicate existing pages of the draft verbatim as context for their changes, which often boil down to: adding a bullet point to a list (e.g. extending the list of keywords), adding a sentence to a pre-existing paragraph (e.g. extending the syntax for lambdas), etc.
You could probably condense the wording down quite a bit, it would be harder to follow what is going on with the changes, but apparently that's what some people who just count page numbers would prefer.
> contract specification alone covers around 5-10% of C++
I have no idea where you read that but it is a blatant lie - easily disproven by the way:
N5046 which is pretty close to the C++26 DIS has 2668 pages. P2900R14 has a total of 114 pages, of which ~56 pages are dedicated to proposed wording.
Wording is presented as a diff to the working draft and contains extensive copies of the existing text that is either amended, modified or removed. (Aka: there are no 56 pages of wording).
> Microsoft apparently criticised the proposal as unimplementable. We're talking about feedback from the dominant compiler vendor.
It's implemented in GCC mainline, it's implemented on a branch of Clang.
Considering MSVC: at this point in time I'm not convinced it it a question of implementability, but of will: https://cppstat.org/de/?tags=cpp26&type=lang
> - let us say tomorrow everyone were to consider removing all unsigned variables across c++
We would have to at the same time consider removing all bit operations (shifts, bit_and, bit_or, complement, xor, ...) as they are generally unsafe for signed integers.
That would probably kill a lot of low-level optimisations you were never actively aware of (some tagged versions of SSO, or pointer tagging in general, ...) but relied on for performance.
So, without thinking of further consequences, I think C++ would be worse of with that proposed change.
It most definitely is not and hasn't been in decades.
A major problem is that some people still put his views on a pedestal, acting like he has a clean track record with his ideas, which he definitely has not - no language designer has ...
That's just a misunderstanding, probably rooted in a pre-published paper that claimed so.
In reality WG21 could just decide to start work on C++29 based on the failed C++26 draft (or the current working draft has already incorporated some C++29 changes)...
Funny how often I read online that Coroutines are abandoned/useless, yet we ship products based on them and their application in our codebases grows continuously...
Sure. But you would have had to use either a 3rd party coroutine library, or have written one yourselves to use coroutines.
C++20 provides the language feature only, and none of the libraries to use the feature. You can write your own library to use the C++20 feature, but the standard APIs are raw and brutally complex. There are 3rd party libraries to use coroutines, but they are not part of the C++20 standard.
C++23 provides a std::generator, which is indeed a great feature.
Finally, C++26 provides std::execution, and std::task, which finally makes the feature usable with only standard C++ feature, and provides facilities for executing coroutines on thread pools, or message pumps. Significant features and problems have been deferred to C++29.
I guess it's a fair point that coroutines have not been abandoned. But it's alarming that it will now take the better part of a decade for the feature to reach a sensible state (depending on how C++26 gets handled).
> You can write your own library to use the C++20 feature, but the standard APIs are raw and brutally complex.
I wouldn't put it that way, but I've written several coroutine wrapper types at this point, so my perspective is certainly not objective here.
> Finally, C++26 provides std::execution, and std::task, which finally makes the feature usable with only standard C++ feature, and provides facilities for executing coroutines on thread pools, or message pumps. Significant features and problems have been deferred to C++29.
I remain unconvinced mere mortals will use std::execution.
It's a marvellous example of proving what is possible with TMP without needing language support.
Naturally, it's template hell - heck, the main designer even wrote a Visual Studio Extension to understand the cryptic error messages it can generate.
Apart from that: it interacts badly with Coroutines. Even though the author of std::execution::task reached quite a good design (there are some warts, some of which could only be fixed by delaying to C++29 as it needed a change to the language feature), std::execution has poor support for it - which is unsurprising as key features of coroutines (like symmetric transfer) are not even discussed in P2300...
That's disappointing. :-( Fwiw, as I remember it, the message pump implementation was easy enough. presumably because it doesn't require symmetric transfers. The thread pool implementation was hell.
WG21 could realistically fix some issues as DRs before S/R is even implemented (and marked stable) anywhere (they have done so before for other features - notably std::format).
Thanks to the C++29 fix you could even remove hacks like `co_yield execution::with_error` as a non-exception-based abort-mechanism inside task.
But ... the problem with symmetric transfer is deeply rooted in the design of std::execution and would require large surgery ...
Centralized motivated groups have more political power than their "percentage" would suggest, that's why we have kosher/gluten/halal labels everywhere.
Merkel needed to ally. It was either the Greens, the communists, or the AfD. Of course the Greens came with closing the power plants.
During that fantastic decision making, Schroder and Merkel moved Germany onto Russia gas. (Of those 2, Schroder now holds management positions in Russian Gazprom, and Russian-German NordStream, the company that owns the pipeline). Brilliant decision making all around.
Their other decisions were to count on America for defense, refusing any investment into defense or defense tech (despite America objecting), and to use China as an export market.
Each of those decisions now, as it turns out, costs every German citizen 3000-6000 euros per year, on a large average, and EU citizens about 5000 euros per year.
Brilliant politician. One would almost think that, since a broken clock is right twice daily, these people weren't at all "wrong" (and certainly Schroder wasn't)
Ah, you're right, that's a bad example. I had assumed that that kind of precondition would be explicitly mentioned so I didn't read the rest of the text as closely as I should have.
Perhaps move-assignment would have been a better example? That one at least mentions construction using an rvalue so I think that specific operation would work for move-only types.
Though now that I think about a bit more I suppose it's a bit of a moot point since the constructors all look like they require a copy-constructible T
The better question you should ask is: who determined that number and put it in their paper with a straight face?
Yes, the section on wording in P2900 is physically 56 pages. That's not 56 pages of new wording though.
For those unaware: Wording is always presented as a diff to the working draft. Apart from new sections that have to be added for contracts, those 56 pages replicate existing pages of the draft verbatim as context for their changes, which often boil down to: adding a bullet point to a list (e.g. extending the list of keywords), adding a sentence to a pre-existing paragraph (e.g. extending the syntax for lambdas), etc.
You could probably condense the wording down quite a bit, it would be harder to follow what is going on with the changes, but apparently that's what some people who just count page numbers would prefer.
reply