Skip to content

[intro.memory] What is an address? #799

@TymianekPL

Description

@TymianekPL

Reference (section label): [intro.memory]

Link to reflector thread (if any): cplusplus/draft#8491

Issue description:

The term address is not defined by C++, yet it is used a lot, for instance when defining the act of representing an address or that each byte has a unique address.

Suggested resolution:

Solution 1: Italicise address

- Every byte has a unique address.
+ Every byte has a unique \defn{address}.

[intro.memory]/1

Solution 2: Define an address as a concept that describes storage for an object

+ An \defnx{address}{address!byte} identifies the storage of each \term{byte} of storage $b$.

[intro.memory]/6

Solution 3: Define an address as the placement of the object representation of an object

  The \defnx{object representation}{representation!object}
  of a complete object type \tcode{T} is the
  sequence of \placeholder{N} \tcode{\keyword{unsigned} \keyword{char}} objects taken up
  by a non-bit-field complete object of type \tcode{T},
  where \placeholder{N} equals
  \tcode{\keyword{sizeof}(T)}.
+ Each object in the sequence is assigned a unique \defn{address} associated with that object.

[basic.types.general]/4


Implementing that could also mean changing every reference of a byte & address to a reference to their definitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions