<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Range/init(_:)-79g1a",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SnsSxRzSZ6StrideRpzrlEySnyxGSNyxGcfc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Creates an instance equivalent to the given `ClosedRange`.

```
init(_ other: ClosedRange<Bound>)
```

## Parameters

`other`

A closed range to convert to a `Range` instance.

## Discussion

An equivalent range must be representable as an instance of Range.
For example, passing a closed range with an upper bound of `Int.max`
triggers a runtime error, because the resulting half-open range would
require an upper bound of `Int.max + 1`, which is not representable as
an `Int`.

---

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)