検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 12 for else (0.022 sec.)
Final Code 12788
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... time. let cap = if mem::size_of::<T>() == 0 { !0 } else { 0 }; // heap::EMPTY doubles as "unallocated" and ... ptr = heap::allocate(elem_size, align); (1, ptr) } else { let new_cap = 2 * self.cap; let ptr = heap::real ... mut self) -> Option<T> { if self.len == 0 { None } else { self.len -= 1; unsafe { Some(ptr::read(self.ptr( ... ce.as_ptr() as usize) + slice.len()) as *const _ } else if slice.len() == 0 { slice.as_ptr() } else { slic ...
https://man.plustar.jp/rust/nomicon/vec-final.html - [similar]
サイズが 0 の型を扱う 12576
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... です。 let cap = if mem::size_of::<T>() == 0 { !0 } else { 0 }; // heap::EMPTY は "アロケートされていない" ... ptr = heap::allocate(elem_size, align); (1, ptr) } else { let new_cap = 2 * self.cap; let ptr = heap::real ... ce.as_ptr() as usize) + slice.len()) as *const _ } else if slice.len() == 0 { slice.as_ptr() } else { slic ... -> Option<T> { if self.start == self.end { None } else { unsafe { let result = ptr::read(self.start); sel ...
https://man.plustar.jp/rust/nomicon/vec-zsts.html - [similar]
IntoIter 8950
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... が出来ません。アロケートされていないからです! *ptr } else { ptr.offset(len as isize) } } } } } 前方へのイテレ ... -> Option<T> { if self.start == self.end { None } else { unsafe { let result = ptr::read(self.start); sel ... -> Option<T> { if self.start == self.end { None } else { unsafe { self.end = self.end.offset(-1); Some(pt ...
https://man.plustar.jp/rust/nomicon/vec-into-iter.html - [similar]
Subtyping and Variance 8843
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... n you pass by-value is fine because there's no one else who "remembers" the old lifetime in the Box. The r ... mut was trouble was because there's always someone else who remembers the original subtype: the actual own ... hat it can only handle &'static str s, and nothing else. Giving &'a str s to it would be unsound, as it's ...
https://man.plustar.jp/rust/nomicon/subtyping.html - [similar]
Unsafe と連携する 8277
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... len() { unsafe { Some(*arr.get_unchecked(idx)) } } else { None } } } この関数は明らかに安全です。インデック ... len() { unsafe { Some(*arr.get_unchecked(idx)) } } else { None } } } 安全なコードを変更しただけなのに 、今 ...
https://man.plustar.jp/rust/nomicon/working-with-unsafe.html - [similar]
print.html 8047
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... len() { unsafe { Some(*arr.get_unchecked(idx)) } } else { None } } } この関数は明らかに安全です。インデック ... len() { unsafe { Some(*arr.get_unchecked(idx)) } } else { None } } } 安全なコードを変更しただけなのに 、今 ... n you pass by-value is fine because there's no one else who "remembers" the old lifetime in the Box. The r ... mut was trouble was because there's always someone else who remembers the original subtype: the actual own ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
アロケーティング 7818
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 下のようなものです。 if cap == 0: allocate() cap = 1 else: reallocate() cap *= 2 しかし、 Rust が唯一サポート ... ptr = heap::allocate(elem_size, align); (1, ptr) } else { // 不変条件ですので、 `self.cap < isize::MAX` と ...
https://man.plustar.jp/rust/nomicon/vec-alloc.html - [similar]
プッシュとポップ 7818
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... mut self) -> Option<T> { if self.len == 0 { None } else { self.len -= 1; unsafe { Some(ptr::read(self.ptr. ...
https://man.plustar.jp/rust/nomicon/vec-push-pop.html - [similar]
RawVec 7818
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ptr = heap::allocate(elem_size, align); (1, ptr) } else { let new_cap = 2 * self.cap; let ptr = heap::real ...
https://man.plustar.jp/rust/nomicon/vec-raw.html - [similar]
チェックされるメモリ 7711
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... きます。 fn main() { let x: i32; if true { x = 1; } else { x = 2; } println!("{}", x); } しかし、このコード ...
https://man.plustar.jp/rust/nomicon/checked-uninit.html - [similar]
PREV 1 2 NEXT