subscript { set } を実現できない。append とか removeLast とかって MutableCollection についてるのかと思ってたけど違った。で、 subscript { set } がないから String は MutableCollection じゃないだろう→ append や removeLast もないだろうと思って勘違いしてた。 https://developer.apple.com/documentation/swift/mutablecollection (edited)String でも平均 O(1) で実現できて問題ないのか。 (edited)