I want to do some calculations on my template arguments and insert them into a tuple and return them. I cannot seem to get the syntax right though. Is it possible?
#include <tuple>
template <typename TupleT, int ...values>
auto create_tuple() {
// Fold expressions does not seem to work
// return TupleT{((values + 1) , ...)};
// This does not work either
// return TupleT{(values + 1) , ...};
// Expected result
// return TupleT{1 + 1, 1 + 2}
}
int main() {
auto t = create_tuple<std::tuple<int, int>, 1, 2>(); // Usage, cannot be changed
}