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
-
SequenceWrapping
is a type-erasing protocol that allows aSequence
-conforming structure to wrap any underlyingSequence
implementation.For example,
PitchSet
andPitchCollection
are both containers forPitch
values, and should both be able to be used asSequence
conforming structures.By conforming to this protocol, the
PitchSet
can use aSet<Pitch>
as its underlying model, whilePitchSequence
can use anArray<Pitch>
as its underlying model.In the conforming
struct
, it is necessary to add a privatevar
which is an implementation of aSequence
-conformingstruct
, which is then given by thesequence
getter.In the
See moreinit
method of the conformingstruct
, set the value of this privatevar
with the givensequence
.Declaration
Swift
public protocol SequenceWrapping : Sequence
-
CollectionWrapping
is a type-erasing protocol that allows aCollection
-conforming structure to wrap any underlyingCollection
implementation.As a result, all of the
See moreCollection
boilerplate is done for free.Declaration
Swift
public protocol CollectionWrapping : Collection
-
Undocumented
See moreDeclaration
Swift
public protocol SortedCollectionWrapping : Collection
-
Interface for wrapping any
RandomAccessCollection
type. TheRandomAccessCollection
interface is exposed, regardless of the concrete implementation of the wrapped type.The performance guarantees made by the
See moreRandomAccessCollection
are sustained.Declaration
Swift
public protocol RandomAccessCollectionWrapping : RandomAccessCollection