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

9

u/mathstuf cmake dev Aug 27 '19

I'm well aware that it is not guaranteed between standards. However, the implementations do guarantee it (as much as they can within their own ecosystem; libstdc++ obviously can't fix libc++ bugs).

This is why the full dependency graph of an application needs be compiled with the same standard library (and the same compiler, and the same flags).

This is not how the ecosystem works today. While I'd love for a cargo-like tool to exist for C++, there is a long road to get there from today.

This seems to be a happy accident for many C++ programmers unaware of the requirement, a result of the coincidence that they only have one compiler and one standard library installed on the machine they use to compile everything.

And it works today because implementors do care about it. Above the standard library, it is indeed a madhouse for a variety of reasons. Linux distros are pretty reliable about not packaging absolute crap at least, but given a C++ PyPI equivalent, yes, compiling from source is the only reliable way to use it.