Skip to content

Instantly share code, notes, and snippets.

@MatejLach
Created July 30, 2014 14:41
Show Gist options
  • Save MatejLach/d7b8c26f43301810e77b to your computer and use it in GitHub Desktop.
Save MatejLach/d7b8c26f43301810e77b to your computer and use it in GitHub Desktop.
An owned Rust pointer example...
fn main() {
let b = box 15i; // `b` is the single owner of this `Box<int>`
let c = &b; // I can have a reference to `b`
println!("{}", c); // Unlike C++, Rust doesn't require dereferencing here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment