Re: does the shared keyword work with mutable structs?

2018-03-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/9/18 2:33 PM, WhatMeWorry wrote: On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote: To make a struct noncopyable, add @disable this(this); to it, then compiler will give an error on an attempt to copy it. I tried the @disable this(this); but now it doesn't even compile? Use pointer

Re: does the shared keyword work with mutable structs?

2018-03-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 09, 2018 19:33:26 WhatMeWorry via Digitalmars-d-learn wrote: > On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote: > > To make a struct noncopyable, add @disable this(this); to it, > > then compiler will give an error on an attempt to copy it. > > I tried the @disable this(thi

Re: does the shared keyword work with mutable structs?

2018-03-09 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote: To make a struct noncopyable, add @disable this(this); to it, then compiler will give an error on an attempt to copy it. I tried the @disable this(this); but now it doesn't even compile? Error: template std.concurrency.spawn cannot deduce

Re: does the shared keyword work with mutable structs?

2018-03-09 Thread Kagamin via Digitalmars-d-learn
To make a struct noncopyable, add @disable this(this); to it, then compiler will give an error on an attempt to copy it.

Re: does the shared keyword work with mutable structs?

2018-03-09 Thread Kagamin via Digitalmars-d-learn
spawn doesn't infer `ref` storage class and copies eventBuffer by value.