News for hackers. Stuff that matters.
Re:C++ the Good Parts (2014) by TinkersW on Thursday October 01, 2020 @08:52AM (#24650281)
C++ does have something along the lines of Rust traits now, it is called concepts and was added in C++ 20.

Mind you it probably has very little real world usage right now..

Concepts aren't as powerful as Rust traits in that they are static dispatch only, while Rust supports both static & dynamic-- but they should make for cleaner code than <type_traits>

Re:C++ the Good Parts (2014) by steveklabnik on Thursday October 01, 2020 @09:42AM (#24650706)
Another large difference (in my understanding) is that you're not actually forced to use concepts; they help if you do use them, but they're not required. Rust pretty much requires that you use a trait for these cases.