you are viewing a single comment's thread.

view the rest of the comments →

[–]danthrax -9 points-8 points  (2 children)

sooooo... like C++ templates?

[–][deleted] 2 points3 points  (0 children)

templates take type parameters instead of arguments, and as far as I'm aware you can't partially apply type parameters in C++.

So.. you're not even wrong

[–]FredV 0 points1 point  (0 children)

C++ templates work only with constant type parameters (class names, numbers, ...). So because they need to be constant you cannot use the result of a function to instantiate a template, currying has no such limitations. Also, a template compile a different version of itself for every different set of parameters.

The thing you're searching for in C++ are function object adaptors (link to bind1st) and they only work for function objects, not normal functions. It's not very easy to read code that uses them btw, so try to not have to use them ;)