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
This commit is contained in:
Abseil Team
2023-03-24 17:03:36 -07:00
committed by Copybara-Service
parent c92b6ce052
commit c9f49460fa

View File

@@ -474,9 +474,14 @@ using swap_internal::StdSwapIsUnconstrained;
} // namespace type_traits_internal
// absl::is_trivially_relocatable<T>
// 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:
//