struct uptr

Declaration

struct uptr { /* full declaration omitted */ };

Description

A pointer-sized unsigned integer. This type is capable of holding a pointer, and is convertible to and from pointers. It is typically the same size as [`usize`]($sus::num::usize) but it can be larger when pointers include additional bits that the address. # Constructing a [`uptr`]($sus::num::uptr) See [`with_addr`]($sus::num::uptr::with_addr) for constructing [`uptr`]($sus::num::uptr) with an address from another [`uptr`]($sus::num::uptr). If pointers contain additional metadata beyond an address, the [`with_addr`]($sus::num::uptr::with_addr) method copies the metadata from the original `uptr` to the newly produced [`uptr`]($sus::num::uptr). Otherwise, constructing a [`uptr`]($sus::num::uptr) from an integer can produce a pointer with invalid (empty) metadata and dereferencing such a pointer would be invalid. To explicitly construct a [`uptr`]($sus::num::uptr) with empty metadata, use `uptr().with_addr(address)`. See the [namespace level documentation]($sus::num) for more.

Declared at: sus/num/unsigned_integer.h:169

Member Variables

public ::sus::num::__private::ptr_type< ::sus::mem::size_of<uintptr_t>()>:: unsigned_type primitive_value = {0U}
The inner primitive value. Prefer to cast to the desired primitive type, such as with `uint32_t{n}` for a numeric value `n`.
public static unsigned long const MIN_PRIMITIVE = __private::min_value<unsigned long>()
The smallest value that can be represented by an [`
public static unsigned long const MAX_PRIMITIVE = __private::max_value<unsigned long>()
The largest value that can be represented by an [`
public static const sus::num::uptr MIN
The smallest value that can be represented by an [`
public static const sus::num::uptr MAX_ADDR
The largest address, the same value as [`usize::MAX`]($sus::num::usize::MAX) but represented as a [`uptr`]($sus::num::uptr).
public static const sus::num::uptr MAX_BIT_PATTERN
The largest value that can be represented by an [`
public static const sus::num::u32 BITS
The size of and [`