explain phantom
This commit is contained in:
parent
0a36ea7db1
commit
06ded9c04e
1 changed files with 3 additions and 0 deletions
|
|
@ -8,6 +8,9 @@ untouched. For now we'll only implement the "basic" full-range version.
|
|||
use std::marker::PhantomData;
|
||||
|
||||
struct Drain<'a, T: 'a> {
|
||||
// Need to bound the lifetime here, so we do it with `&'a mut Vec<T>`
|
||||
// because that's semantically what we contain. We're "just" calling
|
||||
// `pop()` and `remove(0)`.
|
||||
vec: PhantomData<&'a mut Vec<T>>
|
||||
start: *const T,
|
||||
end: *const T,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue