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).
traits
Compile-time meta functions for checking trait conformance across variadic type lists.
comptime values
AllComparable
comptime AllComparable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & ImplicitlyDestructible & Comparable & Equatable)]()
Evaluates to True if all types in Ts conform to Comparable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toComparable.
AllCopyable
comptime AllCopyable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & Copyable & Movable)]()
Evaluates to True if all types in Ts conform to Copyable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toCopyable.
AllDefaultable
comptime AllDefaultable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & Defaultable)]()
Evaluates to True if all types in Ts conform to Defaultable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toDefaultable.
AllEquatable
comptime AllEquatable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & ImplicitlyDestructible & Equatable)]()
Evaluates to True if all types in Ts conform to Equatable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toEquatable.
AllHashable
comptime AllHashable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & Hashable)]()
Evaluates to True if all types in Ts conform to Hashable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toHashable.
AllImplicitlyCopyable
comptime AllImplicitlyCopyable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & ImplicitlyDestructible & Copyable & ImplicitlyCopyable & Movable)]()
Evaluates to True if all types in Ts conform to ImplicitlyCopyable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toImplicitlyCopyable.
AllImplicitlyDestructible
comptime AllImplicitlyDestructible[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & ImplicitlyDestructible)]()
Evaluates to True if all types in Ts conform to ImplicitlyDestructible, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toImplicitlyDestructible.
AllMovable
comptime AllMovable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & Movable)]()
Evaluates to True if all types in Ts conform to Movable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toMovable.
AllRegisterPassable
comptime AllRegisterPassable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & Movable & RegisterPassable)]()
Evaluates to True if all types in Ts conform to RegisterPassable, False otherwise.
Parameters
- *Ts (
AnyType): The types to check for conformance toRegisterPassable.