Re: shared Variant[string]

2015-01-29 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 12:29:09 UTC, Fyodor Ustinov wrote: On Wednesday, 28 January 2015 at 11:27:53 UTC, Kagamin wrote: Associative array doesn't support thread-safe operations, that's why they don't work on shared instance. You should use std.concurrency or implement low-level concu

Re: shared Variant[string]

2015-01-28 Thread Meta via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 12:46:20 UTC, Fyodor Ustinov wrote: On Wednesday, 28 January 2015 at 12:32:29 UTC, Tobias Pankrath wrote: In your case above, it's std.variant : Variant, which does not work when shared. I look into variant.d and after seeing so many lines "@@@ BUG" - strange

Re: shared Variant[string]

2015-01-28 Thread Fyodor Ustinov via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 12:32:29 UTC, Tobias Pankrath wrote: In your case above, it's std.variant : Variant, which does not work when shared. I look into variant.d and after seeing so many lines "@@@ BUG" - strange that it somehow works. :)

Re: shared Variant[string]

2015-01-28 Thread Tobias Pankrath via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 12:29:09 UTC, Fyodor Ustinov wrote: On Wednesday, 28 January 2015 at 11:27:53 UTC, Kagamin wrote: Associative array doesn't support thread-safe operations, that's why they don't work on shared instance. You should use std.concurrency or implement low-level concu

Re: shared Variant[string]

2015-01-28 Thread Fyodor Ustinov via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 11:27:53 UTC, Kagamin wrote: Associative array doesn't support thread-safe operations, that's why they don't work on shared instance. You should use std.concurrency or implement low-level concurrency mechanism. If associative array does not support "share" attr

Re: shared Variant[string]

2015-01-28 Thread Kagamin via Digitalmars-d-learn
Some reading: http://ddili.org/ders/d.en/concurrency.html http://ddili.org/ders/d.en/concurrency_shared.html http://www.informit.com/articles/article.aspx?p=1609144

Re: shared Variant[string]

2015-01-28 Thread Kagamin via Digitalmars-d-learn
Associative array doesn't support thread-safe operations, that's why they don't work on shared instance. You should use std.concurrency or implement low-level concurrency mechanism.

Re: shared Variant[string]

2015-01-28 Thread zhmt via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 10:32:56 UTC, Fyodor Ustinov wrote: On Wednesday, 28 January 2015 at 10:20:42 UTC, zhmt wrote: try __gshared It seems to me - is not the solution, it's a hack. I want to understand what the happening. :) I am new to D. But I that error yesterday, and it's s

Re: shared Variant[string]

2015-01-28 Thread Fyodor Ustinov via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 10:20:42 UTC, zhmt wrote: try __gshared It seems to me - is not the solution, it's a hack. I want to understand what the happening. :)

Re: shared Variant[string]

2015-01-28 Thread zhmt via Digitalmars-d-learn
On Wednesday, 28 January 2015 at 10:16:02 UTC, Fyodor Ustinov wrote: Hi! Simple program: import std.variant; shared Variant[string] t; void main() { t["t"] = "bebebe"; } Without "shared" this program compiles and works. With shared I get: aa.d(6): Error:

shared Variant[string]

2015-01-28 Thread Fyodor Ustinov via Digitalmars-d-learn
Hi! Simple program: import std.variant; shared Variant[string] t; void main() { t["t"] = "bebebe"; } Without "shared" this program compiles and works. With shared I get: aa.d(6): Error: template std.variant.VariantN!32LU.VariantN.opAssign cannot deduce