Wrapping Protocols
-
Undocumented
See moreDeclaration
Swift
public protocol NewType -
Undocumented
See moreDeclaration
Swift
public protocol IntegerWrapping : Comparable, ExpressibleByIntegerLiteral, Hashable -
Undocumented
See moreDeclaration
Swift
public protocol FloatWrapping: ExpressibleByFloatLiteral, ExpressibleByIntegerLiteral, Hashable, Comparable -
Undocumented
See moreDeclaration
Swift
public protocol DoubleWrapping: ExpressibleByFloatLiteral, ExpressibleByIntegerLiteral, Hashable, Comparable -
SequenceWrappingis a type-erasing protocol that allows aSequence-conforming structure to wrap any underlyingSequenceimplementation.For example,
PitchSetandPitchCollectionare both containers forPitchvalues, and should both be able to be used asSequenceconforming structures.By conforming to this protocol, the
PitchSetcan use aSet<Pitch>as its underlying model, whilePitchSequencecan use anArray<Pitch>as its underlying model.In the conforming
struct, it is necessary to add a privatevarwhich is an implementation of aSequence-conformingstruct, which is then given by thesequencegetter.In the
See moreinitmethod of the conformingstruct, set the value of this privatevarwith the givensequence.Declaration
Swift
public protocol SequenceWrapping : Sequence -
CollectionWrappingis a type-erasing protocol that allows aCollection-conforming structure to wrap any underlyingCollectionimplementation.As a result, all of the
See moreCollectionboilerplate is done for free.Declaration
Swift
public protocol CollectionWrapping : Collection -
Undocumented
See moreDeclaration
Swift
public protocol SortedCollectionWrapping : Collection -
Interface for wrapping any
RandomAccessCollectiontype. TheRandomAccessCollectioninterface is exposed, regardless of the concrete implementation of the wrapped type.The performance guarantees made by the
See moreRandomAccessCollectionare sustained.Declaration
Swift
public protocol RandomAccessCollectionWrapping : RandomAccessCollection
View on GitHub
Install in Dash
Wrapping Protocols Reference