@ -691,7 +691,7 @@ extension Container where Item: Equatable {
|
|||||||
|
|
||||||
## 具有泛型 Where 子句的关联类型 {#associated-types-with-a-generic-where-clause}
|
## 具有泛型 Where 子句的关联类型 {#associated-types-with-a-generic-where-clause}
|
||||||
|
|
||||||
你可以在关联类型后面加上具有泛型 `where` 的字句。例如,建立一个包含迭代器(`Iterator`)的容器,就像是标准库中使用的 `Sequence` 协议那样。你应该这么写:
|
你可以在关联类型后面加上具有泛型 `where` 的子句。例如,建立一个包含迭代器(`Iterator`)的容器,就像是标准库中使用的 `Sequence` 协议那样。你应该这么写:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
protocol Container {
|
protocol Container {
|
||||||
|
|||||||
Reference in New Issue
Block a user