Could you translate this line of code to plain English?

protocol Container {

associatedtype Item

mutating func append(_ item: Item)

var count: Int { get }

subscript(i: Int) -> Item { get }


associatedtype Iterator: IteratorProtocol where Iterator.Element == Item

func makeIterator() -> Iterator

}


protocol ComparableContainer: Container where Item: Comparable { }



I'm having trouble understanding the last line of code. Does it mean "create ComparableContainer and make it conform to Container whose Item adopts Comparable" ?

Quoting from The Swift Programming Language (Swift 4), that line "declares a ComparableContainer protocol which requires Item to conform to Comparable:"

Accepted Answer

It means:


"Create a different protocol called ComparableContainer which does everything that Container does, but requires that the associated type must conform to Comparable."


In other words, ComparableContainer defines a more restricted protocol than Container.

Could you translate this line of code to plain English?
 
 
Q