Safer casts

Yigal Chripun yigal100 at gmail.com
Sun May 11 18:03:39 PDT 2008


Janice Caron wrote:
> On 12/05/2008, Yigal Chripun <yigal100 at gmail.com> wrote:
>> I don't know about any plans to change the dm linker.
> 
> You do now. :-)
> 
> The following is an exact word-for-word quote, posted 23 Mar by Walter Bright:
> 
> "Templatizing is the language solution. I know about the bloat
> problem, but that is really an implementation issue. I know the linker
> doesn't do it now, but identical blocks of generated code with
> different names should be merged."
> 
>
I know about that quote. that doesn't mean anything. saying that
something should be done in a specific way is not the same as saying one
would work to make that something work in that specific way.
Walter acknowledges some problems with the linker, he also said that
fixing that is a huge amount of work for the reasons I've stated in a
previous post. so that doesn't mean Walter is planning to fix those
problems in the near future.



> 
>>  what i mean was doing something like this:
>>  <snip>
> 
> And that's a perfectly reasonable strategy, but it only works for
> pointers to structs. (In D, it won't work for class references).
> Structs, by contrast, should probably be written into a collection by
> value, not by reference. In short, it's a C++-specific strategy.
hmm... you're right... :(
maybe there is a way to adapt that way of thinking to D or maybe this
would be optimized automatically by the liker in the future, as you say
all i can say is that I hope the linker will be worked on...



More information about the Digitalmars-d mailing list