[swift-users] adopting RandomAccessCollection protocol
don-giovanni at hotmail.com
Sun Mar 12 03:37:02 CDT 2017
I'm trying to adopt the RandomAccessCollection protocol from a class. I deliberately leave out the func index(before:) function because there is already a default implementation of that function in RandomAccessCollection. I do understand that that function's implementation is required because of BiDirectionalCollection from which RandomAccessCollection inherits.
My question is why would the compiler complain that func index(before:) implementation is required when there is already a default implementation in RandomAccessCollection that i can use?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users