swift - Can an Associated Type be restricted by protocol conformance and a where-clause? -


i'm trying:

public protocol myprotocol {     associatedtype myarray: rangereplaceablecollectiontype myarray.generator.element == mytype     //... } 

the protocol has property prototype of type [mytype]. decided generalize it. made associated type. can have conform best container type (rangereplaceablecollectiontype) syntax errors when added where clause. there (other) way specify not want generic container, restrict element type?


Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file -