Is the following cast legal with dmd 2.040?
struct MyChar
{
dchar d;
this(dchar param)
in {
assert(false); // not called
}
body
{
d = param;
assert(d != param); // not called
}
this(this)
in {
assert(false); // not
> ...
>
> I see that neither the constructor nor the postblit is called.
> Apparently the bit representation is used. This has the risk of
> violating struct invariants.
>
> Is it legal?
>
> Thank you,
> Ali
cast is to value conversions what a tactical nuclear strike is to
peaceful negotiations
Daniel Keep wrote:
>> ...
>>
>> I see that neither the constructor nor the postblit is called.
>> Apparently the bit representation is used. This has the risk of
>> violating struct invariants.
>>
>> Is it legal?
>>
>> Thank you,
>> Ali
>
> cast is to value conversions what a tactical nuclear stri
Daniel Keep wrote:
...
I see that neither the constructor nor the postblit is called.
Apparently the bit representation is used. This has the risk of
violating struct invariants.
Is it legal?
Thank you,
Ali
cast is to value conversions what a tactical nuclear strike is to
peaceful negotiatio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ali Çehreli wrote:
> Daniel Keep wrote:
>>> ...
>
Well I forget the details, but it's been pointed out before
that D's cast is fundamentally broken.
You get one cast operator that hides the full set of c++
static, dynamic, const & reinterpret casts.
Daniel Keep:
> [1] Except for int<->float. Oh, and objects. Really, this is one thing
> I could just about strangle K&R for: conflating value-preserving,
> non-value-preserving *AND* unsafe conversions all into a single
> construct. Walter, gets slapped with a fish for not putting a bullet in
>