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

Tino Heth 2th at gmx.de
Wed Jul 6 15:07:44 CDT 2016


> 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/20160706/8997460e/attachment.html>


More information about the swift-users mailing list