Structure

Dictionary.Index

The position of a key-value pair in a dictionary.

Declaration

@frozen struct Index

Overview

Dictionary has two subscripting interfaces:

  1. Subscripting with a key, yielding an optional value:

    v = d[k]!
    
  2. Subscripting with an index, yielding a key-value pair:

    (k, v) = d[i]
    

Topics

Instance Properties

var hashValue: Int

The hash value.

Beta

Instance Methods

func hash(into: inout Hasher)

Hashes the essential components of this value by feeding them into the given hasher.

Operator Functions

static func != (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Bool

Returns a Boolean value indicating whether two values are not equal.

static func ..< (Dictionary<Key, Value>.Index) -> PartialRangeUpTo<Dictionary<Key, Value>.Index>

Returns a partial range up to, but not including, its upper bound.

static func ..< (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Range<Dictionary<Key, Value>.Index>

Returns a half-open range that contains its lower bound but not its upper bound.

static func < (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Bool

Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

static func <= (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Bool

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

static func == (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Bool

Returns a Boolean value indicating whether two values are equal.

static func > (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Bool

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

static func >= (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index) -> Bool

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

Relationships

From Protocol

See Also

Supporting Types

struct Dictionary.Keys

A view of a dictionary’s keys.

struct Dictionary.Values

A view of a dictionary’s values.

struct Dictionary.Iterator

An iterator over the members of a Dictionary<Key, Value>.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software