Does TArray::Pop always return and delete the last added element?

The documentation only says:

Pops element from the array.

I wondered whether it gives me the first element (0) or the last added element (n-1).

Cheers

You can look at the actual code instead of documentation:

RemoveAt(ArrayNum - 1, 1, bAllowShrinking);

ArrayNum - 1 means it’s the last element.

1 Like