Hacker News new | ask | show | jobs
by lorenzhs 3416 days ago
Yes, generics in Java or templates in C++ is how any algorithms library would handle this. Any type passed into such a function needs to possess the required operators and functions or it will fail to compile/run.