Re: [swift-users] Constrained protocol extensions

2016-06-09 Thread Jordan Rose via swift-users
Swift generics are not like C++ templates; they are built on dynamic dispatch at runtime instead of instantiation, much like Java interfaces. Overload resolution, on the other hand, happens at compile-time, with "more specific” overloads being preferred over “less specific” ones. (The exact orde

Re: [swift-users] Constrained protocol extensions

2016-06-09 Thread apetro...@outlook.com via swift-users
Hi Ian, You're right, if there's a function that's specialized everything works well (actually, I deleted exactly the same function from my example, in an attempt to be brief and succinct :) ). But that kind of ruins the whole point of interface specialization and violates the principle of leas