Re: Non movable structs

2016-06-24 Thread Nick Treleaven via Digitalmars-d
On Sunday, 19 June 2016 at 02:06:59 UTC, deadalnix wrote: Long story short, I need structs that do not move. I'm sure there are many other use cases. This would be useful for std.typecons.scoped - class instances can be moved otherwise (which is illegal). I think if structs can disable mov

Re: Non movable structs

2016-06-19 Thread Mathias Lang via Digitalmars-d
Normally, you would need to disable both identity opAssign and postblit and it should work. At the moment, it works for the struct itself, however it breaks when the struct is nested in another one. There are a couple of issues I am currently looking into fixing (after an IRC discussion with Eyal).

Re: Non movable structs

2016-06-19 Thread Adrian Matoga via Digitalmars-d
On Sunday, 19 June 2016 at 02:06:59 UTC, deadalnix wrote: Long story short, I need structs that do not move. I'm sure there are many other use cases. I needed that for a struct member function to be passed as delegate for a fiber. The easiest way I found was to malloc the struct.

Re: Non movable structs

2016-06-18 Thread ketmar via Digitalmars-d
On Sunday, 19 June 2016 at 02:06:59 UTC, deadalnix wrote: Long story short, I need structs that do not move. I'm sure there are many other use cases. there definitely are. Eyal from Weka, for example, desperately wants 'em to implement intrusive lists, and even created a bug report[1] for the

Non movable structs

2016-06-18 Thread deadalnix via Digitalmars-d
Well all is in the title. Is there a way to achieve this ? If not, would this be possible to make this happen ? Background: I'm working on synchronization primitives for SDC's runtime. All the cool kids synchronization primitives rely on the mutex's address to do various things. Making the m