template<class R, class...Args>
auto Y = [](auto f) {
auto action = [](auto f, auto&& action)->std::function<R(Args...)> {
return [f, action](Args&&...args)mutable ->R{
return f( action(std::ref(f), action), std::forward<Args>(args)... );
};
};
return action(f, action);
};
Some fun C++ stuff I've done round here:
std::function
.+
.std::function
that returns vectors of its own type.Here is a neat question I didn't ask:
the answer seems to be "actually, nope, but nobody noticed".
An amusing link:
which will show your reputation history on stack overflow, if you like that kind of thing.
ey eir em