Lt
trait Lt<T>
Source: compiler/src/builtin_docs/prelude/ops.hy The less-than operator <.
a < b on a type with an Lt instance calls lt(a, b).
Required methods#
| Name | Description |
|---|---|
lt | Returns true when a is less than b. |
Examples#
use tests::assert;
class Version {
pub n: int,
}
impl Lt for Version {
pub fn lt(Version a, Version b) -> bool {
return a.n < b.n;
}
}
fn main() {
assert!(new Version(1) < new Version(2));
}