0

Seems like I cant use a tuple in a loop, also I tried using static integer (instead of "int i" without loop) it didn't work. (no instance of overloaded function "std::get" matches the argument list).

#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>

int main() {
    std::tuple<int, int, int> a = std::make_tuple(0, 1, 2);

    for (int i = 0; i < 3; i++) {
        //it breaks here
        std::cout << std::get<i>(a);

    }

    return 0;
}

0 Answers0