Handle inserting from rdcarray into itself
* This self-insertion has the same kind of problem as overlapping ranges in memcpy, the act of inserting items can affect the input range by shifting things around. For inserting a single object we just copy it, for inserting a range we duplicate the whole array and then do the insert from the old range (and destruct it). * Clearly this is not the most efficient implementation, a better solution would be to append onto the existing array (potentially not even reallocating then) and doing a rotate/shift in place.
Loading
Please register or sign in to comment