银河美术馆 Gallery of Galaxy

银河美术馆 Gallery of Galaxy, Yanli 盐粒's Blog

  • Blog
  • About
  • RSS
  • Search
  • Program (10)
  • Weekly (12)
  • Life (2)
  • Tech (2)
  • Algorithm (1)
  • Learn (1)
  • Rust (1)
  • EN (1)
  • ZH (1)

Rust: A Generally View of Reference and Its Mutability

Feb 18, 2023

A reference (&) is used to access or change data without taking responsibility for it. This is more like a pointer in C/C++ than a reference in C++. In Rust, a reference is usually not changeable, but it can be made changeable at the top or bottom level. Automatic dereferencing is used to work out if a reference should act like an alias or a pointer.


© Yanli 盐粒 2022 - 2025