I have not used std::tuple lot in C ++, and I have the following tuple:
std::tuple<int, int> range {0, 100};
This is the range for my mysql query:
prestmt_ = con_ -> prepareStatement("SELECT example_value FROM example_table WHERE example_column = '0' LIMIT ?, ?"); prestmt_ -> setInt(1, std::get<0>(range)); prestmt_ -> setInt(2, std::get<1>(range));
I use the tuple structure to make it clear that two integers are associated with the operation of the function.
I need to increment tuple integers after each query:
range = std::tuple<int, int>(std::get<0>(range) + 100, std::get<0>(range) + 100);
This redistribution looks very bad and not very readable. Is there a better way to edit these tuple values?
source share