How do you get T from shared(T) ?

Marco Leise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 28 07:41:16 PDT 2014


Am Sun, 28 Sep 2014 14:07:22 +0000
schrieb "tcak" <tcak at gmail.com>:

> On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote:
> > For head-unshared there is `static if (is(T U : shared U))`.
> > But how do you get the unshared type for anything from `shared
> > void*` to `shared uint` ?
> 
> shared int a;
> 
> int b = cast()a;

No, I mean for `shared void*`, too. But I special cased for
one level of pointer indirection now, so it works.

-- 
Marco



More information about the Digitalmars-d-learn mailing list