<!--
{
  "availability" : [
    "iOS: 12.2.0 -",
    "iPadOS: 12.2.0 -",
    "macCatalyst: 12.2.0 -",
    "macOS: 10.14.4 -",
    "tvOS: 12.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Span/isIdentical(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s4SpanVsRi_zrlE11isIdentical2toSbAByxG_tF"
  },
  "title" : "isIdentical(to:)"
}
-->

# isIdentical(to:)

Returns a Boolean value indicating whether two instances refer to the same
memory region.

```
func isIdentical(to other: Span<Element>) -> Bool
```

## Parameters

`other`

A span to compare with this one.

## Return Value

Whether `self` and `other` reference the same region
in memory.

## Discussion

Two spans are identical if they reference the same starting address
and have the same number of elements.

> Complexity: O(1)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)