>>55の回答はこんな感じでいいだろう
using ptr_type = void *;
std::function<ptr_type ()> f1{ []{ return ptr_type{}; } };

std::function<void *()> f2{ []{ return static_cast<void *>(nullptr); } };