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

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

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

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.

does the shared keyword work with mutable structs?

2018-03-08 Thread WhatMeWorry via Digitalmars-d-learn
I read where shared classes have not been implemented yet. So I'm using just a struct e below: But the output below is showing that sharing is not happening between Struct in main() and the various spawned threads. I'm I doing something wrong? creating queue in EventBuffer constructor