I have been having the following problem:
std::tuple<Ts...> some_tuple = std::tuple<Ts...>();
for (int i = 0; i < 2; i++) {
const int j = i;
std::get<j>(temp_row) = some_value;
}
Does not compile: (in xcode) it says " no matching function call for 'get' ".
However, the following works fine:
std::tuple<Ts...> some_tuple = std::tuple<Ts...>();
for (int i = 0; i < 2; i++) {
const int j = 1;
std::get<j>(temp_row) = some_value;
}
Does it have something to do with defining the value of a constant to be the value of a variable?
Thanks!
EDIT: The difference is in the const int j = i;
vs. const int j = 1;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…