Skip to content

const option on pointers and slices themselves #23

Description

@esthedebeste

the difference between

int *a; // a is a mutable pointer (can be moved) to a mutable integer (can be changed)
int *const b; // b is a constant pointer (cannot be moved) to a mutable integer (can be changed)
const int *c; // c is a mutable pointer (can be moved) to a constant integer (cannot be changed)
const int *const d; // d is a constant pointer (cannot be moved) to a constant integer (cannot be changed)

currently cannot all be represented.

a: int32* := ...; // a is a constant pointer (cannot be moved) to a constant integer (cannot be changed)
b: int32* .= ...; // b is a mutable pointer (can be moved) to a mutable integer (can be changed)

are all we can represent at the moment.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions