3 ms·
Depends what you mean I guess. You can certainly write code that doesn't create more generic structs, and needing to create more generic structs when writing si
by gpm 6y ago
Depends what you mean I guess. You can certainly write code that doesn't create more generic structs, and needing to create more generic structs when writing simple application plumbing code is relatively rare. On the flip side you also certainly want to use stdlib (and third party) libraries and instantiate generic structs they define. For example a list of T objects is most commonly stored in a Vec<T> where T is a generic, or for a builtin example a fixed sized array is a `[T; N]` where both T and N are generic. There's also approximately no reason to avoid generics.
All in all the frequency of use of generics is pretty similar to languages like C++ or Scala.