what exactly does cast(shared) and cast away shared do?
Kagamin
spam at here.lot
Wed Jun 17 09:37:00 UTC 2020
On Tuesday, 16 June 2020 at 07:22:59 UTC, mw wrote:
> `shared` or not is purely a compile-time attribute, not some
> runtime dynamic attribute on the object, i.e. at runtime when
> you get hold of an object on the heap, there's no way you can
> tell from the object itself whether it's shared or not.
The way to tell it is if the object is typed as shared, then it's
shared, if it's not typed as shared, then it's not shared. The
only way to circumvent this is to use a cast, that circumvents
entire type system.
More information about the Digitalmars-d
mailing list