On 12/31/13 6:39 AM, Oren Ben-Kiki wrote:
Great news... I'll admit I have no idea what "unboxed closures" are,
exactly, google wasn't helpful finding out a post clearly describing
them. The example in
http://www.mail-archive.com/[email protected]/msg07569.html shows
passing a closure to a map, so it obviously isn't a call-once so it
can't consume an owned pointer. E.g., if it was `|&x| x +
f(move-some-owned-pointer-from-the-context-to-be-consumed-by-f)`, then
it wouldn't - and shouldn't - work.
Presumably along with `Fn<T,U>` there will be something like `OnceFn<T,U>`:
trait OnceFn<Ret,Args...> {
fn call(self, args: Args) -> Ret;
// ^^^^ note by-value self; this is what makes it one-shot
}
Note: This is just a strawman sketch of the idea; it may well not work,
no promises, etc.
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev