<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/libkern/bounded_ptr",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@N@libkern@ST>2#T#T@bounded_ptr"
  },
  "title" : "bounded_ptr"
}
-->

# bounded_ptr

```
template <typename T, typename TrappingPolicy> struct bounded_ptr;
```

## Topics

### Instance Properties

[`CharType * base_;`](/documentation/DriverKit/libkern/bounded_ptr/base_)

[`uint32_t count_;`](/documentation/DriverKit/libkern/bounded_ptr/count_)

[`int32_t offset_;`](/documentation/DriverKit/libkern/bounded_ptr/offset_)

### Instance Methods

[`bounded_ptr<T, TrappingPolicy>(const bounded_ptr<U, Policy> & other);`](/documentation/DriverKit/libkern/bounded_ptr/bounded_ptr_T,_TrappingPolicy_-1tcde)

[`bounded_ptr<T, TrappingPolicy>(detail::nullptr_t );`](/documentation/DriverKit/libkern/bounded_ptr/bounded_ptr_T,_TrappingPolicy_-1uygx)

[`explicit bounded_ptr<T, TrappingPolicy>();`](/documentation/DriverKit/libkern/bounded_ptr/bounded_ptr_T,_TrappingPolicy_-1zrzr)

[`explicit bounded_ptr<T, TrappingPolicy>(T * *pointer, const type-parameter-0-0 *begin, const type-parameter-0-0 *end);`](/documentation/DriverKit/libkern/bounded_ptr/bounded_ptr_T,_TrappingPolicy_-wo1c)

[`type-parameter-0-0 * discard_bounds() const;`](/documentation/DriverKit/libkern/bounded_ptr/discard_bounds)

[`type-parameter-0-0 * get_ptr_() const;`](/documentation/DriverKit/libkern/bounded_ptr/get_ptr_)

[`bool in_bounds_() const;`](/documentation/DriverKit/libkern/bounded_ptr/in_bounds_)

[`template <typename T_ = T> T_ & & operator*();`](/documentation/DriverKit/libkern/bounded_ptr/operator*)

[`bounded_ptr<T, TrappingPolicy> operator++(int );`](/documentation/DriverKit/libkern/bounded_ptr/operator++-1qlf9)

[`bounded_ptr<T, TrappingPolicy> & operator++();`](/documentation/DriverKit/libkern/bounded_ptr/operator++-64dbu)

[`template <typename T_ = T> bounded_ptr<T, TrappingPolicy> & operator+=(ptrdiff_t n);`](/documentation/DriverKit/libkern/bounded_ptr/operator+=)

[`bounded_ptr<T, TrappingPolicy> operator--(int );`](/documentation/DriverKit/libkern/bounded_ptr/operator---43kvo)

[`bounded_ptr<T, TrappingPolicy> & operator--();`](/documentation/DriverKit/libkern/bounded_ptr/operator---6btzk)

[`template <typename T_ = T> bounded_ptr<T, TrappingPolicy> & operator-=(ptrdiff_t n);`](/documentation/DriverKit/libkern/bounded_ptr/operator-=)

[`type-parameter-0-0 * operator->() const;`](/documentation/DriverKit/libkern/bounded_ptr/operator-_)

[`template <typename U, typename Policy, typename = detail::detail::enable_if_t<detail::is_convertible_v<U *, T *>>> bounded_ptr<T, TrappingPolicy> & operator=(const bounded_ptr<U, Policy> & other);`](/documentation/DriverKit/libkern/bounded_ptr/operator=-5l0bz)

[`bounded_ptr<T, TrappingPolicy> & operator=(detail::nullptr_t );`](/documentation/DriverKit/libkern/bounded_ptr/operator=-6wg8h)

[`template <typename T_ = T> T_ & & operator[](ptrdiff_t n);`](/documentation/DriverKit/libkern/bounded_ptr/operator__)

[`explicit operator _Bool() const;`](/documentation/DriverKit/libkern/bounded_ptr/operator_bool)

[`type-parameter-0-0 * unsafe_discard_bounds() const;`](/documentation/DriverKit/libkern/bounded_ptr/unsafe_discard_bounds)

### Type Aliases

[`typedef detail::detail::copy_cv_t<T, char> CharType;`](/documentation/DriverKit/libkern/bounded_ptr/CharType)

---

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)