For learning purposes, I'm creating a container, based from an array with map-like functionality. Every time I insert a key, I want to keep the array ordered. I have already implemented functions to find where the key should go in the arrays index, the only issue I have currently is efficiently shifting the array elements.
I have a simple loop to do this:
for (size_t i = mSize; i > n; i--)
{
mCont[i] = mCont[i - 1];
}
However, I'd like to possibly use something such as memmove to be able to do this quicker -but I'm not sure how to use it- when the container grows in size.
Thanks for your time.