On Mon, Jan 27, 2014 at 12:03 PM, Niko Matsakis <[email protected]> wrote:
> On Sat, Jan 25, 2014 at 07:07:32PM +0100, Gábor Lehel wrote: > > If you wanted to pass an unboxed closure without indirection though, like > > `fn foo<T: Fn<U, R>>(x: T)`, then you would have to explicitly > dereference > > the closure, i.e. `foo(*|u| r)` (which might be OK). > > Why would you want to do that? There is no advantage to doing so; the ABI > will almost certainly reintroduce indirection anyhow. > I think this question has a more general form, namely: when should I pass by value and when using &move/&my? I expect this will come up quite a bit if we add the latter. > > > The basic problem is that there's a zoo of closure types: > > http://glaebhoerl.tumblr.com/rust_closure_types (I will be referring to > > things from this in the following!) > > No time to write a long response here just now, but this is a very > nice writeup, thanks. > > > > Niko >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
