4 ms·
I see. In e.g Swift, you'd have to define before hand that T1 could be used with <= while here I guess it adds in the method for "each" T1 that could be used w
by seivan 11y ago
I see.
In e.g Swift, you'd have to define before hand that T1 could be used with <= while here I guess it adds in the method for "each" T1 that could be used with it.
I assume this just duplicates the method for each type at compile time instead of at runtime try to figure it out?
Damnit, now I wanna rewrite back to C++.
- jschwartzi 11y agoIn C++ it just prints an error message and halts compilation if you try to use a type which doesn't support the semantics of the template function. It does not add functions which are not declared already.
- aldanor 11y agoThat's what C++ concepts are for (maybe we'll see them in C++17).