2017-01-20から1日間の記事一覧

Lifetimes

https://doc.rust-lang.org/book/lifetimes.html を少々。 fn main() { let r; // Introduce reference: r { let i = 1; // Introduce scoped value: i r = &i; // Store reference of i in r } // i goes out of scope and is dropped. println!("{}", r); …