protocol LexicographicComparable<Self> { ... }

Mixin to provide a default implementation of Comparable for a type

This mixin provides a default implementation of compare for a type. If the type is a struct, it will compare each field lexicographically in order of declaration. If the type is an enum, it will compare the underlying value.

If any field is not comparable, this will result in a compilation error.

Example

Provided methods