Re: Pass Tid[string] to another thread (by send)

2016-08-05 Thread TencoDK via Digitalmars-d-learn
On Friday, 5 August 2016 at 13:14:41 UTC, Kagamin wrote: Bug 6585 is not fixed. Variant wasn't written for shared and immutable types. As a workaround wrap the array in a class. Thanks! It worked. Though it's strange that Variant wasn't written for shared and immutable types because, for

Pass Tid[string] to another thread (by send)

2016-08-04 Thread TencoDK via Digitalmars-d-learn
Hi! I'm trying to make threads communicate by sending an immutable address book to each thread. Code: Tid[string] addressBook; addressBook["Some"] = sdfsdf; addressBook["Input"] = sdfsdf; auto sharedAddressBook = cast(immutable(Tid[string]))(addressBook); send(tid, sharedAddressBook);

Re: Instantiate C struct on heap

2016-08-04 Thread TencoDK via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:21:14 UTC, Adam D. Ruppe wrote: On Thursday, 4 August 2016 at 21:02:59 UTC, TencoDK wrote: derelict/window.d (binding from C): struct sfWindow; That kind of struct isn't supposed to be created directly... there should be a create window function in the

Re: Instantiate C struct on heap

2016-08-04 Thread TencoDK via Digitalmars-d-learn
On Thursday, 4 August 2016 at 21:02:59 UTC, TencoDK wrote: Hey, I'm using DerelictSFML2 + CSFML, I have stuck on instantiating window. derelict/window.d (binding from C): struct sfWindow; my_file.d: sfWindow* sfmlWindow = null; sfmlWindow = new sfWindow; // ??? This code snippet gives me:

Instantiate C struct on heap

2016-08-04 Thread TencoDK via Digitalmars-d-learn
Hey, I'm using DerelictSFML2 + CSFML, I have stuck on instantiating window. derelict/window.d (binding from C): struct sfWindow; my_file.d: sfWindow* sfmlWindow = null; sfmlWindow = new sfWindow; // ??? This code snippet gives me: Error: struct derelict.sfml2.window.sfWindow unknown size