[swift-users] Why does RangeReplaceableCollection require an empty initialiser?

Tim Vermeulen tvermeulen at me.com
Wed Jul 6 18:27:04 CDT 2016


The same is true for protocols such as `RandomAccessCollection` and `MutableCollection`.

> On 6 Jul 2016, at 22:07, Tino Heth <2th at gmx.de> wrote:
> 
> 
>> I thought this was it, but none of the default implementations of RangeReplaceableCollection seem to use this empty initialiser
> I haven't worked with RangeReplaceableCollection yet, but I wasn't speaking of how the protocol is used in the libraries, but by "regular users":
> 
> class Factory<T: RangeReplaceableCollectionType> {
> 	func create() -> T{
> 		return T()
> 	}
> }
> 
> Doing something like this can become really hard when you need parameters.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160707/ffd9ef12/attachment.html>


More information about the swift-users mailing list