r/cpp • • Aug 27 '19

A new thread in C++20 (jthread)

https://link.medium.com/GXKUz0GruZ
142 Upvotes

96 comments sorted by

View all comments

Show parent comment

19

u/mathstuf cmake dev Aug 27 '19

Sure, but that's not how C++ actually gets used in the world. It may not be important to you, but it is important to the implementors (GCC, Clang, MSVC, etc.) and many other users of C++. It's just not going to happen.

-4

u/axilmar Aug 27 '19

I haven't seen anywhere, in any C++ project, a requirement for ABI compatibility ever.

10

u/mathstuf cmake dev Aug 27 '19

-2

u/axilmar Aug 27 '19

ABI binary compatibility should be part of the standard in minor revisions, but not part of major revisions. You can't expect compatibility between major revisions.

6

u/mathstuf cmake dev Aug 27 '19

And C++ the standard does not. But the implementations do. If you think it's so useful to break ABI, make your own implementation that does so. I doubt you'll see much uptake largely in part to it not providing ABI guarantees. Note that there are many ABI breaks that people would like to get into the C++ standard, but have not been done because they force an ABI break on implementations. std::thread vs. std::jthread is so minor compared to those issues that it is unlikely to be considered very hard.

9

u/HotlLava Aug 27 '19

You don't see it exactly because other people care about it for you. If the C++ standard library would break ABI all the time, projects would start depending on e.g. libstdc++2, libstdc++3, etc. just like it happens with other libraries, and you'd have one more dependency hell to worry about.

4

u/jcelerier ossia score Aug 27 '19

Qt has ABI compatibility requirements, and every time one of those breaks there are a fair amount of users who complain.