c++ generic compile-time for loop
问题 In some contexts, it could be useful/necessary to have a for loop evaluated/unrolled at compile time. For example, to iterate over the elements of a tuple , one needs to use std::get<I> , which depends on a template int parameter I , hence it has to be evaluated at compile time. Using compile recursion one can solve a specific problem, as for instance discussed here, here, and, specifically for std::tuple here. I am interested, however, on how to implement a generic compile-time for loop. The