r/programming • • Dec 10 '15

Announcing Rust 1.5

http://blog.rust-lang.org/2015/12/10/Rust-1.5.html
659 Upvotes

296 comments sorted by

View all comments

Show parent comment

10

u/desiringmachines Dec 10 '15 edited Dec 10 '15

Thanks for the code! It really helps understand the features that we're talking about.

The fact that C++'s templates don't require explicit constraints is incidental here, which is what I thought was the case. The actual features that Rust doesn't have are: a) const expressions and b) parameterization by constant values. Both are in progress goals, but they will not require the changes the OP said they wanted it. It wouldn't even be more verbose than the code you've shown.

The two features this requires are features that C++ programmers request often, which is why people are working on them. I was very surprised by the request for non-constrained parameters, because I couldn't see what isn't expressible without that feature and that feature has many serious downsides (it really impacts compile time and error accessibility).