草庐IT

ValuedThing

全部标签

swift - 在 Swift 4 中,您能否编写仅适用于遵守多种协议(protocol)的事物的扩展?

考虑这些协议(protocol)protocolNamedThing{varname:String{get}}protocolValuedThing{associatedtypeValueTypevarvalue:ValueType{get}}还有这些结构...structTestThingA:NamedThing{letname="TestThing"}structTestThingB:ValuedThing{typealiasValueType=Intletvalue=4}structTestThingC:NamedThing,ValuedThing{typealiasValueT