Non movable structs

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 24 03:52:25 PDT 2016


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 moving, we can make a non-escaping 
slice wrapper. Very useful for enforcing @safe, e.g. for slicing 
static arrays.


More information about the Digitalmars-d mailing list