[Feature request]TArray::RemoveAtSwap return value

Hi. Now this function’s return value is void. It will be nice if it return an index of the item inserted instead of removed one.
It is useful to remap TMap indices related to this array. Now it’s impossible to use RemoveAtSwap because it ruins an index order inside array without any chances to fixup related name maps.

If what you need is the index of the element that has been swapped, you don’t need any return values: RemoveAtSwap removes an item from an index, and moves the element at the end of the array to that index to “fill in the gap”, so the element which had index [array.Num()-1] has the index passed as argument after RemoveAtSwap. That is the only reordering that happens.
Not sure if this answers your question, but hope it helps.

Thanks. Now I already use method you adviced. It’s just an attempt to make this not so hacky.