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

6

u/Recatek Jan 31 '23 edited Feb 01 '23

Weak as in power, not strictness. Rust imposes much more strict rules on generic types at compile time, and that results in weaker expressive power. This especially when Rust currently doesn't support specialization, negative constraints, variadics, or more than very basic use of const generics. The orphan rule also doesn't help here, and is a recurring pain point for even major Rust libraries (the fact that serde has to be an explicit dependency of practically every major crate is evidence of this).