Tag: 深拷贝

什么是深刻复制二维MutableList简洁的方式?

元素已经实现了深度复制。 fun <T : DeepCopiable> f(a: MutableList<MutableList<T>>) { val copied = a.map { it.map { it.deepCopy() }.toMutableList() }.toMutableList() … } 我正在使用这种代码,但似乎冗长。