|
|
|
|
|
by inglor
3811 days ago
|
|
This is how C++ templates work. They are a form of polymorphism through how you use the object and not based on its type. If you pass a type that cannot be used with the <= operator it will error in compile time. Being able to do this is part of why C++ templates are much more powerful than Java/C# generics and why they enable a different (and alternative) form of polymorphism to inheritance and explicit interfaces. |
|
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++.