The constructor form you invoke is ** :
template <class Iterator> vector(Iterator start, Iterator end);
So, you can pass everything that acts as a pair of iterators. In particular, you can pass two pointers if they both point to the same array, and until the second comes before the first (if the pointers are equal, they represent an empty range).
() elment-after-the-last-element :
vector<int> vec(arr, arr + sizeof(arr) / sizeof(int));
, .
vec arr?
:
vector<int> vec(arr, arr+3);
3?
, , - . 1 4:
vector<int> vec(arr+1, arr+4);
**
, , , . : template <class InputIterator>
vector( InputIterator first, InputIterator last,
const Allocator& alloc = Allocator() );