All quizzes
C++CoreFill the blank

Fill in the blank so the loop doubles every element of v in place. The element type must be captured by mutable reference.

#include <vector>
int main() {
    std::vector<int> v{1, 2, 3};
    for (____ : v) {   // declare the loop variable here
        n *= 2;
    }
}