I want to copy an array using range for
. Is it possible?
Something like (obviously not working)
unsigned arr[15] = {};
unsigned arr2[15];
for (auto i : arr, auto &j : arr2)
j = i;
Or are there some other tricks to avoid operating the size of arrays, if I know for sure they are of the same lenght?
UPD I really like the @PavelDavydov solution. But could anyone please offer a standard lib only solution. C++11 contains pairs and tuples too.
for (auto pair : std::make_tuple(&arr, &arr2));