In the Swift 2 guide there is this line :
p. 133: find()
is no longer available as a free function. It is now CollectionType.indexOf(_:)
:
Could you please explain what is a “free function” ?
Thanks
In the Swift 2 guide there is this line :
p. 133: find()
is no longer available as a free function. It is now CollectionType.indexOf(_:)
:
Could you please explain what is a “free function” ?
Thanks
A free function is one that does not require an object instance to invoke it on. For example, the print function in Swift is a free function.
print ("Jibber Jabber") // free
foo.print ("Jibber Jabber") // not free - bound to foo
Thanks