[D-runtime] dup attributes?

Fawzi Mohamed fawzi at gmx.ch
Fri Aug 6 04:35:57 PDT 2010


On 6-ago-10, at 13:09, Steve Schveighoffer wrote:

> ----- Original Message ----
>> From: Fawzi Mohamed <fawzi at gmx.ch>
>>
>> well it is not so clear to me what the  flags of a~b should be if  
>> the flags of
>> a & b happens to be different.
>> I  think that probably always using the default type flags from the  
>> typeinfo
>> for  the result is the way to go.
>
> What about an intelligent choice?  For example, the NO_SCAN bits  
> should be
> and-ed.  That's what I was thinking.  But of course, this means N  
> flag lookups,
> so there is a performance concern.

I dislike "intelligent choices" if they have a cost and makes  
dependencies less local (as here),
unless it is really what one would expect.
In this case if I use a global void[], of ubyte[] buffer to do  
concatenation of arbitrary types of the results change,
and it is unclear how to extend the behaviour wrt. exact scanning  
should be.
It seems a source of hard to track bugs...

The cost should not be really too much, but I prefer that the target  
type "decides" the correct flags.
Using templates one can make it so that the target type is the correct  
one.
It is faster and, IMHO, logically as well founded as the alternatives,
thus I would keep the current behaviour (It is also less work :).


More information about the D-runtime mailing list