提交 b6caedbc 编写于 作者: I Ilya Gorbunov

Add operator to Comparable.rangeTo

上级 e09c0ae2
......@@ -27,7 +27,7 @@ public class ComparableRange<T: Comparable<T>> (
* Creates a range from this [Comparable] value to the specified [that] value. This value
* needs to be smaller than [that] value, otherwise the returned range will be empty.
*/
public fun <T: Comparable<T>> T.rangeTo(that: T): ComparableRange<T> {
public operator fun <T: Comparable<T>> T.rangeTo(that: T): ComparableRange<T> {
return ComparableRange(this, that)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册