I have a C array of int
s, and its size, i.e. int* arr, unsigned size
. I want to have something like a view from it, which will have pairs of int
s as elements.
To clarify, the task is: I receive an array like [1,2,3,4]
and I want a view, which will be something like [(1,2),(3,4)]
.
Is there any convenient way to transform array in such a way via boost, or maybe, ranges (std::ranges, or range-v3)?
ranges::v3::view::chunk(2)
creates a range of range(of size 2). – Lafave