null Vs [] return arrays

bearophile bearophileHUGS at lycos.com
Sun Mar 27 14:46:53 PDT 2011


Jonathan M Davis:

> the compiler can likely make 
> assumptions about null that it can't make about [], since it probably treats 
> [] more generally without worrying about the fact that it happens to be empty 
> as far as optimizations go - that and there _is_ a semantic difference between 
> null and [] if you're messing with the ptr property, so Walter may think that 
> it's best for null to not be turned into the same thing as [] automatically.

Thank you for your answer. I have added a low-priority enhancement request.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list