3 ms·
The main benefit of generics is to easily maintain strong type information for implementers. With a <T>createMapWithStringKey(T arg) -> Map<string, T> You
by mekkkkkk 6y ago
The main benefit of generics is to easily maintain strong type information for implementers.
With a
<T>createMapWithStringKey(T arg) -> Map<string, T>
You can keep strong type info with
AType a
var b = createMapWithStringKey<AType>(a)
// b is for certain a Map<string, AType>