There are three ways to implement generics:
Just a tool for compile time checks, but every template instance is compiled to the same byte/assembly code implementation (Java, as noted in comments "type erasure" implementation)
Each template instantiation is compiled to specialized code (C++, C#)
Combination of #1 and #2
Which one is implemented in Swift?
See Question&Answers more detail:os