The overload resolution of NullCheckedInvocation::invoke fails, because std::function<Signature...>&& is not a forwarding ref, just an rvalue ref. I can’t find a more elegant solution than to make identical overloads for all cv and ref qualified variants of std::function.
That fixes this crash, but may leave the issue open for a future one. It happens that anything that doesn’t match the exact type will go to the unchecked overload, for example
std::function<int(int)> foo;
NullCheckedInvocation::invoke (foo, 3); // a non-const lvalue
NullCheckedInvocation::invoke (std::function<int(int)>(), 5); // an rvalue
(edit) Maybe this would work? It checks anything that can be initialised with nullptr.