Skip to content
Ville Rissanen edited this page Sep 20, 2021 · 1 revision

var curry(arguments...)

  • arguments... - variables to apply as curried arguments to the invokable.

This macro acts like a function. It inserts an empty lambda as a first argument for a call to:

template<typename UniqueDummy, typename... Arguments>
libletlib::detail::curry_(UniqueDummy&&, var const& invokable, Arguments const&... arguments)

which forces unique instantiations of the template because the C++ standard guarantees all lambdas are unique types.

Example

let invokable = []lambda(st + nd);
let curried = curry(invokable, 2);
std::cout << curried(2) << std::endl; // print "4"

Clone this wiki locally