如https://www.scala-lang.org/api/current/scala/math/Ordering.html:
trait Ordering[T] extends Comparator[T] with PartialOrdering[T] with Serializable
为什么 trait Ordering 需要实现 Serializable?我认为没有需要将 Ordering 的实例保存在文件中或通过网络传输的情况。如果有这个要求,似乎不是 Ordering 的责任来处理它< /p>
谢谢!