Re:Why the C++ standard ships every three years
by steveklabnik on Saturday July 13, 2019 @05:02PM
(#20430139)
In general, it’s a thing more newer languages are moving to, because it’s regarded as superior for a few different reasons. Mostly, it keeps the syntax more regular when you have type inference. See Kotlin as another recent example.
In rust, we have additional reasons, and that’s because it’s not
let name: type = expression;
It’s
let pattern: type = expression;
Patterns offer more power than simple variable declarations. The names may not correspond 1-1 with the type, because you can create multiple names by destructuring more complex types
In rust, we have additional reasons, and that’s because it’s not
It’s Patterns offer more power than simple variable declarations. The names may not correspond 1-1 with the type, because you can create multiple names by destructuring more complex types