No, you can't because a
would need to be a constexpr
when passed to the function (and no, constructing a const int
in the function body is not gonna help). You can use a template argument instead:
template<std::size_t I>
auto getValue() -> decltype(std::get<I>(v_tuple)) {
return std::get<I>(v_tuple);
}