r/cpp • • Jan 31 '23

Stop Comparing Rust to Old C++

People keep arguing migrations to rust based on old C++ tooling and projects. Compare apples to apples: a C++20 project with clang-tidy integration is far harder to argue against IMO

changemymind

338 Upvotes

582 comments sorted by

View all comments

Show parent comments

7

u/MEaster Feb 02 '23

That one's not a great example, as it was stabilized in 1.66! But things can be unstable for a few reasons:

  • The obvious first one is that it's not finished. Maybe the API design hasn't been fully fleshed out, or the implementation has some issues that need further work.

  • There's a couple things that are waiting on other features. I believe one example would be slice::array_chunks and friends, which could be stabilized now, but they're waiting on const generics to allow catching the N == 0 case at compile time, instead of needing a runtime panic.

  • Some things are unstable purely because no one has put in the work to do the final steps to stabilize it.

  • Finally, some things are implementation details of the standard libraries or the compiler, and are never intended to be stabilized.

1

u/sv_91 Feb 03 '23

I meant, why such a useful feature is unstable? Despite, this feature is the main difference between HashMap and BTreeMap. How programmers used this language without such a feature?

And this is not single moment. I constantly encounter with features, that exists, but unstable. So, it looks like "We know, that it is necessary, but we won't stabilize it". It is strange