Re:Swift: Madness of Generic Integer
by __m on Tuesday March 03, 2015 @06:35PM
(#9141565)
how would the compiler know what numbers to expect at runtime?
[ Parent
| on HN ]
Either by specializing the generic code to the specific types at compile time, or by using dynamic dispatch. (Note that this is the same tradeoff you get if you write the non-generic code by hand, so generics don't create a tradeoff where there wasn't one already.)