std.concurrency doesn't like structs, classes?

Sean Kelly sean at invisibleduck.org
Fri May 24 14:22:59 PDT 2013


On May 23, 2013, at 11:49 AM, "Luís.Marques" <luismarques at gmail.com>"@puremagic.com <luismarques at gmail.com> wrote:

> On Thursday, 23 May 2013 at 18:38:05 UTC, Ali Çehreli wrote:
>> As a workaround, try immutable(S*) (S is a struct). You must manage the lifetime of the object of course.
> 
> I was actually investigating std.concurrency to try to understand the mechanism of dispatching the messages of different types (I needed to figure out a mechanism to accept subclasses).
> 
> Since some things were not clear to me, I thought the easier solution was just to progressively strip std.concurrency, until I isolated the functionality I wanted. But now that seems a dead end, since std.concurrency itself does not work for classes.

It should work for any type that Variant can represent.  I know Variant has trouble with immutable however.  Have you tried shared?  std.concurrency finds a match via Variant.convertsTo, so it should be able to handle subclassing.


More information about the Digitalmars-d mailing list