|
|
Log in / Subscribe / Register

The 5.7 kernel is out

The 5.7 kernel is out

Posted Jun 1, 2020 20:24 UTC (Mon) by mathstuf (subscriber, #69389)
In reply to: The 5.7 kernel is out by Wol
Parent article: The 5.7 kernel is out

There are folks working on standalone contexts for standard C++, but it is in progress and probably won't land everything Linux would likely want/need until C++26. It mostly works by stripping down stdlib features though. You're still stuck with bad language behaviors.


to post comments

The 5.7 kernel is out

Posted Jun 1, 2020 20:37 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link] (3 responses)

Some of them DID get fixed, like vector<bool>.

The 5.7 kernel is out

Posted Jun 2, 2020 1:49 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (2 responses)

Do you have a paper number for that?

The 5.7 kernel is out

Posted Jun 2, 2020 2:27 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

I think P1957R2 but I can swear I've seen another one about implicit bool casts.

The 5.7 kernel is out

Posted Jun 2, 2020 2:44 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

Those papers do nothing about vector<bool>'s problems:

- auto& item = boolvec[3]; is busted as you get a proxy object instead of a real boolean
- does not work with parallel algorithms (the bits all write to the same byte and collide there)
- T* data = vec.data(); doesn't work in generic code when passed a vector<bool>
- I'm sure there are others

It's just a bad design the standard allows (it's not even required!) that won't get fixed due to ABI guarantees stdlib implementers are basically bound by from the ecosystem. Sure, the standard can tell them to do something, but they can also say "sorry, no can do" (they effectively have a veto on such things because of this).

The paper you refer to is basically about making T* -> bool a warning due to bugs and weird typesystem holes you fall into with the implicit cast floating about your generic code.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds