The list is being constructed based on the address of the array which is the first element, to the last element which is calculated based on the first elements address incremented on by the size of the array.
This code works because arrays are stored in a contiguous fashion in C++? allowing us to use pointer arithmetic (beginning address plus total values should give us the end)?
If this is true then the list construction calls what constructor i.e. what are the paramater types?
The code works because a pointer to an element of a C-style array is an iterator. This uses the constructor of std::list that takes two InputIterators.
given an array a, the line const int* p = a; is compiled as const int* p = & a[0]; or, equivalently, const int* p = std::begin(a) ;
When you're using a C array as an argument to a function or operator that expects a pointer parameter and does not expect an array, the compiler constructs a temporary pointer to its first element (which is also its begin iterator)