array cast should be supported corrected

BCS ao at pathlink.com
Wed Aug 6 14:06:21 PDT 2008


Reply to Frank,

> However. What is better in a template arraycast with o(n) or a cast?
> The programmer always needs to know what the concequences are. With
> this argumentation the string concatenation ~ should also be banned from
> the language, because hidden heap allocation has always unbound execution
> time.

Array cat's /always/ do a O(?) allocation and a O(n+m) copy. Cast usually 
does a O(1) transformation. Having the corner case be much worse than the 
normal case is the problem, not the fact it's O(n).





More information about the Digitalmars-d mailing list