struct
DictionaryIndex
<
Key
:
Hashable
,
Value
>
Inheritance |
Comparable, Equatable
View Protocol Hierarchy →
|
---|---|
Import |
|
Instance Methods
Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.
This function is the only requirement of the Comparable
protocol. The
remainder of the relational operator functions are implemented by the
standard library for any type that conforms to Comparable
.
Parameters: lhs: A value to compare. rhs: Another value to compare.
Declaration
func
<
(
lhs
:
DictionaryIndex
<
Key
,
Value
>
,
rhs
:
DictionaryIndex
<
Key
,
Value
>
) -
>
Bool
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values a
and b
,
a == b
implies that a != b
is false
.
Parameters: lhs: A value to compare. rhs: Another value to compare.
Declaration
func
==(
lhs
:
DictionaryIndex
<
Key
,
Value
>
,
rhs
:
DictionaryIndex
<
Key
,
Value
>
) -
>
Bool
Used to access the key-value pairs in an instance of
Dictionary<Key, Value>
.Dictionary has two subscripting interfaces:
Subscripting with a key, yielding an optional value:
v = d[k]!
Subscripting with an index, yielding a key-value pair:
(k, v) = d[i]