Adam D. Ruppe's "D Cookbook" now available!

Adam D. Ruppe via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Jun 10 10:50:06 PDT 2014


On Tuesday, 10 June 2014 at 17:31:52 UTC, Lars T. Kyllingstad 
wrote:
> Like the fact that you can @disable this() for a struct, even 
> though you can't implement it.

If my memory is working properly I actually think I was the one 
who suggested that to Walter a few years ago when it was 
introduced, though odds are I stole the idea from somebody else 
first and my memory is just a bit selectively egotistical :P

But I think @disable is a really cool thing for so many reasons. 
The two first ideas I had with it was the not null and ranged 
integer structs. Then the move semantics can come from it too. So 
can selectively disabling other operator overloads; forwarding 
most things to a member but filtering out some operations.

Disabling default construction still has a few compiler bugs so 
it isn't watertight but I've found it is really nice to have.


More information about the Digitalmars-d-announce mailing list