2 ms·
I think we agree that Rust allows generic code to be constrained, which means it can be eagerly type checked at the definition site. Contrast to C++ templates w
by duped 4y ago
I think we agree that Rust allows generic code to be constrained, which means it can be eagerly type checked at the definition site. Contrast to C++ templates which are unconstrained meaning the compiler can't type check until they're expanded (barring the use of concepts).
What I was trying to say is that whether or not concrete type of a generic argument can be used as a constraint is orthogonal to those semantics, it's an implementation detail.