[fpc-pascal] dynamic array contents and system.move
dle3ab at angelbase.com
Mon Apr 26 03:27:07 CEST 2010
Florian Klaempfl wrote:
> If you mess with move and have no clue about internals, then you get
> burned. Period. Proper dyn. array code uses copy(...) instead of move.
I wish there was a type-checked equivalent to what move does. copy creates a new
array, and I don't want to do that: I already have a big block of memory
reserved in the dynarray. I just want to move some data into that space --
sometimes only a part of it. Is there any alternative?
It would be nice if move would give a compiler warning or note if it receives a
pointer-pointer. I guess that would require move doing type-checking... but at
compile-time, is there anything wrong with move doing such a type-check and
issuing a warning?
More information about the fpc-pascal