Any one could explain me what is the meaning of past-the-end. Why we call end() function past-the-end?
Adding another point to the above correct answers. This was also done to be compatible with arrays. For example in the code below:
char arr[5];
strcpy(arr, "eakgl");
sort(&arr[0], &arr[5]);
This will work fine.
Instead if you had given :
sort(&arr[0], &arr[4]);
it would miss sorting the last character.
This also helps to represent empty containers naturally.