Positions and permitted operations

Pointers support indirect object access and, where permitted, refer to functions. The C++ working draft distinguishes pointers to objects or functions, past-the-end pointers, null pointers, and invalid pointers. These categories do not permit identical operations.

A pointer is not simply an ordinary integer in every language or implementation. The C++ draft leaves its representation implementation-defined and distinguishes object identity from storage addresses. Conversions and access therefore require the applicable language and platform rules.

References: [1]

Past-the-end values can mark a boundary

A past-the-end pointer can represent a sequence boundary without identifying an extra readable array element. Equal address representations do not establish that two values legitimately designate the same object under the applicable pointer rules.

After storage is released, retaining its old address does not retain access to the former object. Object lifetime and storage duration require separate consideration. A variable can still display an address even though dereferencing its value is no longer valid.

References: [1] [2]

Copying a location does not copy responsibility

Several pointers may concern one object without specifying who releases it or whether their accesses may overlap. Ownership, mutable access, and lifetime constraints need types, interfaces, or additional management rules.

Rust references constrain access through borrowing, while unsafe pointer operations must uphold their required conditions. C++ resource handles can also express release responsibility. Using a pointer and providing a sound resource-management contract are related but separate design decisions.

References: [3] [2] [4]