vector<int> is{ 0, 1, 2, 3, 4 }; transform_view squares{is, [](int i) { return i * i; }}; for (int i : squares) cout << i << ' '; // prints: 0 1 4 9 16