From e68f1412e2cebdd5af106721007335ca45d51f83 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 15 Sep 2023 08:14:33 -0700 Subject: Allow const qualified FunctionRef instances. This allows the signature to be compatible with AnyInvokable for const uses. PiperOrigin-RevId: 565682320 Change-Id: I924dadf110481e572bdb8af0111fa62d6f553d90 --- absl/functional/function_ref.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'absl/functional/function_ref.h') diff --git a/absl/functional/function_ref.h b/absl/functional/function_ref.h index 2b9139d3..96cece55 100644 --- a/absl/functional/function_ref.h +++ b/absl/functional/function_ref.h @@ -137,6 +137,14 @@ class FunctionRef { absl::functional_internal::Invoker invoker_; }; +// Allow const qualified function signatures. Since FunctionRef requires +// constness anyway we can just make this a no-op. +template +class FunctionRef : public FunctionRef { + public: + using FunctionRef::FunctionRef; +}; + ABSL_NAMESPACE_END } // namespace absl -- cgit v1.2.3