P3817 — loops

◀ back to the paper

Reassigned every iteration

Point latest{};                // the result, kept outside the loop

Today

for (auto& [pos, t] : trajectory) {
    latest = pos;              // pos exists only to be handed to latest
    plot(latest, t);
}

With P3817

for (auto& [using latest, t] : trajectory) { plot(latest, t); }