IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

is_trivially_copyable

def is_trivially_copyable[T: Copyable]() -> Bool

Returns whether T has a trivial copy constructor.

A copy constructor is trivial when the compiler generates it and all of T's fields are themselves trivially copyable. In practice this means the value can be copied by duplicating its bits to a new location without any additional side effects.

Deprecated: 'is_trivially_copyable' is deprecated, use 'IsTriviallyCopyable' instead

Parameters:

Returns:

Bool: True if T has a trivial copy constructor.