Steven Schveighoffer <schvei...@yahoo.com> wrote:

You are again resorting to implementation. I guess in the current implementation it's true that the compiler will indeed insert a call to its internal function. But the language spec does not proscribe that.


Sure it does. It says that setting the length may reallocate the array to hold enough space. How do you do that without a function call?

As long as the compiler is aware of arrays' existence, and knows how
those functions work, there might indeed be an optimization that turns
length+=1;length-=1; into a nop. There isn't at the moment, and there
might never be, but it's a conceivable optimization.

--
Simen

Reply via email to