From c9f49460fa38cc24c3f476eb2998abca105cf63d Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 24 Mar 2023 17:03:36 -0700 Subject: type_traits: touch up the docs for is_trivially_relocatable. Clarify that the trait is conservative: it's safe to act on if it's true, but false doesn't necessarily mean anything. Of course this is the only reasonable way to use it, but I think it's helpful to be explicit, especially because currently this trait *always* returns false on some platforms even for a type like int. PiperOrigin-RevId: 519272294 Change-Id: Ic63a48dcf18efc0756046b3d6f51d11cbb46a469 --- absl/meta/type_traits.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'absl/meta') diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h index fb12ba4a..25462580 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h @@ -474,9 +474,14 @@ using swap_internal::StdSwapIsUnconstrained; } // namespace type_traits_internal // absl::is_trivially_relocatable -// Detects whether a type is "trivially relocatable" -- meaning it can be -// relocated without invoking the constructor/destructor, using a form of move -// elision. +// +// Detects whether a type is known to be "trivially relocatable" -- meaning it +// can be relocated without invoking the constructor/destructor, using a form of +// move elision. +// +// This trait is conservative, for backwards compatibility. If it's true then +// the type is definitely trivially relocatable, but if it's false then the type +// may or may not be. // // Example: // -- cgit v1.2.3