我可以這樣做:斯威夫特擴展:將在那裏和協議堅持
extension Dictionary : MyProtocol {}
,我可以這樣做:
extension Dictionary where Key: String, Value: Int {}
,但我不能做到這一點:
extension Dictionary where Key: String, Value: Int : MyProtocol {}
或更多:
extension Dictionary : MyProtocol where Key: String, Value: Int {}
格式化的正確方法是什麼,以允許我指定類型並指定遵守協議?