Function memoized now handles std::function.