2017-03-15から1日間の記事一覧

Choosing your Guarantees

https://doc.rust-lang.org/book/choosing-your-guarantees.html Guaranteesは保証という意味の単語らしい。 use std::cell::Cell; use std::cell::RefCell; fn main() { let x = Cell::new(1); let y = &x; let z = &x; x.set(2); y.set(3); z.set(4); prin…