protocol MyProtocol {}
func foo<Item: MyProtocol>(item: Item) {
//...
}
I have a function foo
that takes an item conforming to the MyProtocol
protocol. Now I want the function also to accept arrays of items conforming to MyProtocol
. Is it possible to make Array<MyProtocol>
itself conform to MyProtocol
?