[swift-corelibs-dev] [Proposal] RangeReplaceableCollection should inherits from MutableCollection
Tony Parker
anthony.parker at apple.com
Sat Dec 2 14:19:35 CST 2017
Hi Jiannan,
I think you’ll get a better answer to your question on the ‘swift-dev’ list, actually.
Hope this helps,
- Tony
> On Dec 2, 2017, at 9:08 AM, Cao, Jiannan via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
>
> Hi everyone,
>
> I'd like to discuss the relation between RangeReplaceableCollection and MutableCollection
>
> MutableCollection is a Collection type that can { set } any element with subscript(position: Index). (and also { set } for subscript(range: Range<Index>))
>
> RangeReplaceableCollection requires a function replaceRange(_:with:)
>
> If a type conforms to RangeReplaceableCollection, it means any of its range can be replaced, that includes the situation to replace only one element.
> So if some type conforms to RangeReplaceableCollection, it is sufficient to be a MutableCollection.
> So I think the RangeReplaceableCollection should conforms to MutableCollection should inherits from MutableCollection.
>
> Thanks!
> Jiannan
>
>
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
More information about the swift-corelibs-dev
mailing list