summaryrefslogtreecommitdiff
path: root/absl/functional/function_ref.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-08-20 22:47:15 -0700
committerGravatar rogeeff <rogeeff@google.com>2021-08-24 03:24:23 -0400
commit9134967d017fcd09f71539c8957b73eb05c26f45 (patch)
tree4e241d0ebded6663028d518a4885431741e225b8 /absl/functional/function_ref.h
parentf39e6ad4753e06d4a0d6a9bf6310478757479984 (diff)
Export of internal Abseil changes
-- 2aa219620f39aa490fa989f5d92e1bd3e52a46c5 by Abseil Team <absl-team@google.com>: Add lifetime annotations to FunctionRef. PiperOrigin-RevId: 392131866 GitOrigin-RevId: 2aa219620f39aa490fa989f5d92e1bd3e52a46c5 Change-Id: I295b808986857e46a565e047db25a951dd7ce0e3
Diffstat (limited to 'absl/functional/function_ref.h')
-rw-r--r--absl/functional/function_ref.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/absl/functional/function_ref.h b/absl/functional/function_ref.h
index 5790a652..824e3cea 100644
--- a/absl/functional/function_ref.h
+++ b/absl/functional/function_ref.h
@@ -50,6 +50,7 @@
#include <functional>
#include <type_traits>
+#include "absl/base/attributes.h"
#include "absl/functional/internal/function_ref.h"
#include "absl/meta/type_traits.h"
@@ -98,7 +99,8 @@ class FunctionRef<R(Args...)> {
public:
// Constructs a FunctionRef from any invokable type.
template <typename F, typename = EnableIfCompatible<const F&>>
- FunctionRef(const F& f) // NOLINT(runtime/explicit)
+ // NOLINTNEXTLINE(runtime/explicit)
+ FunctionRef(const F& f ABSL_ATTRIBUTE_LIFETIME_BOUND)
: invoker_(&absl::functional_internal::InvokeObject<F, R, Args...>) {
absl::functional_internal::AssertNonNull(f);
ptr_.obj = &f;