Код: Выделить всё
auto getVerticesAndNormalsForIndices(const std::vector& indices, const std::vector
& allVertices, const std::vector& allNormals)
{
std::vector vertices(indices.size());
std::vector normals(vertices.size());
std::ranges::transform(indices, std::views::zip(vertices, normals).begin(), [&allVertices, &allNormals](const size_t i)
{
return std::pair{ allVertices[i], allNormals[i] };
});
return { std::move(vertices), std::move(normals) };
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... containing