diff options
Diffstat (limited to 'absl/functional/internal/function_ref.h')
-rw-r--r-- | absl/functional/internal/function_ref.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/functional/internal/function_ref.h b/absl/functional/internal/function_ref.h index a1ddbb0c..1cd34a3c 100644 --- a/absl/functional/internal/function_ref.h +++ b/absl/functional/internal/function_ref.h @@ -20,6 +20,7 @@ #include <type_traits> #include "absl/base/internal/invoke.h" +#include "absl/functional/any_invocable.h" #include "absl/meta/type_traits.h" namespace absl { @@ -90,6 +91,12 @@ void AssertNonNull(const std::function<Sig>& f) { (void)f; } +template <typename Sig> +void AssertNonNull(const AnyInvocable<Sig>& f) { + assert(f != nullptr); + (void)f; +} + template <typename F> void AssertNonNull(const F&) {} |