Fully transitive const is not necessary

Sascha Katzner sorry.no at spam.invalid
Sun Apr 27 13:56:57 PDT 2008


Walter Bright wrote:
> Most operations are slicing/concatenating, which work just fine on
> invariant strings.

Correct me if I'm wrong, but if you want to concatenate two invariant 
strings, you have to allocate a new buffer. Isn't that a possible speed 
penalty compared to regular strings? Since if you use regular strings 
you can allocate one of the two string buffers beforehand big enough and 
save this allocation, with invariant strings you don't have this option.

...or to rephrase my question, wouldn't a StringBuilder Class without 
invariant strings be much faster?

LLAP,
Sascha



More information about the Digitalmars-d mailing list