mirror of
https://github.com/elasota/Aerofoil.git
synced 2026-03-01 13:25:23 +00:00
22 lines
368 B
C
22 lines
368 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
|
||
|
|
namespace PortabilityLayer
|
||
|
|
{
|
||
|
|
class ArrayTools
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
template<class T, class TSize, class TIndex>
|
||
|
|
static void RemoveFromArray(T *arr, TSize &count, TIndex index)
|
||
|
|
{
|
||
|
|
TSize countCopy = count;
|
||
|
|
countCopy--;
|
||
|
|
if (countCopy != index)
|
||
|
|
arr[index] = arr[countCopy];
|
||
|
|
|
||
|
|
count = static_cast<TSize>(countCopy);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|