Re:Methods for Array Initialization in Rust (2018)
by masklinn on Monday May 24, 2021 @02:15PM
(#27267800)
Because Rust’s generics are patterned after Haskell’s (traits are dual to type classes), not C++’ templates.
Re:Methods for Array Initialization in Rust (2018)
by Diggsey on Sunday May 30, 2021 @07:16PM
(#27337930)
You're conflating traits with generics. Generics exist without traits, and in Rust they are more closely aligned with C++ templates than anything else, since they are implemented via monomorphisation, whereas in Haskell they are not.
Regardless, Rust is not "patterned" after a single other language. It's influenced by many langauges, so it makes no sense to say that one feature is just copied straight from a specific other language.
Other languages in the same domain (like D) also have variadic generics.