Thanks for the detailed answers!
Yes, I accept that immutable guarantees should be implemented
only during @safe that doesn't call into @trusted.
On Friday, 15 February 2019 at 18:59:36 UTC, H. S. Teoh wrote:
At the very least, such [union] code should be automatically
@system.
Sensible.
On Fri, Feb 15, 2019 at 03:50:33AM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Friday, February 15, 2019 3:06:34 AM MST Kagamin via Digitalmars-d-learn
> wrote:
> > Union is just a pretty cast, type system guarantees don't hold for
> > it.
>
> Well, technically, what's supposed
On Friday, February 15, 2019 3:06:34 AM MST Kagamin via Digitalmars-d-learn
wrote:
> Union is just a pretty cast, type system guarantees don't hold
> for it.
Well, technically, what's supposed to be the case is that when you cast, the
type system guarantees still hold but it's up to the
Union is just a pretty cast, type system guarantees don't hold
for it.
On Thursday, February 14, 2019 11:59:31 PM MST Stefan Koch via Digitalmars-
d-learn wrote:
> On Thursday, 14 February 2019 at 23:55:18 UTC, SimonN wrote:
> > std.typecons.Rebindable!(immutable A) is implemented as:
> > private union {
> >
> > immutable(A) original;
> > A
On Thursday, 14 February 2019 at 23:55:18 UTC, SimonN wrote:
std.typecons.Rebindable!(immutable A) is implemented as:
private union {
immutable(A) original;
A stripped;
}
...@trusted assignment operators...
@property inout(immutable(A)) get() @trusted pure
std.typecons.Rebindable!(immutable A) is implemented as:
private union {
immutable(A) original;
A stripped;
}
...@trusted assignment operators...
@property inout(immutable(A)) get() @trusted pure nothrow
@nogc inout
{
return original;
}