struct
CollectionOfOne
<
T
>
Inheritance |
CollectionType, Reflectable, SequenceType, _CollectionType, _SequenceType, _Sequence_Type
View Protocol Hierarchy →
|
---|---|
Associated Types |
A type that represents a valid position in the collection. Valid indices consist of the position of every element and a "past the end" position that's not valid for use as a subscript.
Type alias inferred.
Type alias inferred.
Type alias inferred.
Type alias inferred. |
Import |
|
Initializers
Construct an instance containing just element
.
Declaration
init
(
_
element
:
T
)
Instance Variables
The "past the end" position; always identical to
startIndex.successor()
.
Note: endIndex
is not a valid argument to subscript
.
Declaration
var
endIndex
:
Index
{
get
}
The position of the first element.
Declaration
var
startIndex
:
Index
{
get
}
Subscripts
Declaration
subscript
(
position
:
Index
) -
>
T
{
get
}
Instance Methods
Return a generator over the elements of this sequence.
Complexity: O(1)
Declaration
func
generate
() -
>
GeneratorOfOne
<
T
>
A collection containing a single element of type
T
.