// A proof: print array[] indices that correspond gslice(3, {2,3}, {11,3}):
#include <algorithm>
#include <iostream>
#include <numeric>
#include <ranges>
#include <valarray>
auto main() -> int {
std::valarray<int> va(32);
std::iota(std::begin(va), std::end(va), 0);
std::gslice g(
3, // offset==3
{2, 3}, // {sizes}: size[0]==2, size[1]==3
{11, 3} // {strides}: stride[0]==11, stride[1]==3
);
std::valarray<int> va2 = va[g];
// print array[] indices: 3 6 9 14 17 20
std::ranges::for_each(va2, [](int x) {
std::cout << "array[" << x << "], ";
});
}