Skip to main content
Version: Nightly

traits

Compile-time meta functions for checking trait conformance across variadic type lists.

comptime values

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 to Copyable.

AllDefaultable

comptime AllDefaultable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & ImplicitlyDestructible & Defaultable)]()

Evaluates to True if all types in Ts conform to Defaultable, False otherwise.

Parameters

  • *Ts (AnyType): The types to check for conformance to Defaultable.

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 to Equatable.

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 to Hashable.

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 to ImplicitlyCopyable.

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 to ImplicitlyDestructible.

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 to Movable.

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 to RegisterPassable.

AllWritable

comptime AllWritable[*Ts: AnyType] = TypeList.all_satisfies[comptime[Type: AnyType] conforms_to(Type, AnyType & ImplicitlyDestructible & Writable)]()

Evaluates to True if all types in Ts conform to Writable, False otherwise.

Parameters

  • *Ts (AnyType): The types to check for conformance to Writable.