I have an implementation that works for me in the following way:
// clase de enteros modulo el parametro N
template<unsigned N> int_mod_N {
unsigned m_i; // unico datro miembro
/* ... implementacion ...*/
};
// clase que es una "tupla" de los anteriores enteros modulo N
// pero cada posicion de la tupla puede tener un modulo diferente
template<unsigned N_n,unsigned ... N_nm1>
struct producto_cartesiano_enteros_modulos_Ns {
int_mod_N<N_n> m_msd;
producto_cartesiano_enteros_modulos_Ns<N_nm1...> m_resto;
// no hay mas datos miembros
// implementacion utilizando recursion
};
The problem is that everything I do is already done in < tuple & gt ;. However I do not know how to implement the constructors, etc. I also hoped that I could use the entire tuple at the same time, without having to delegate recursion. But there is no tutorial on youtube or writing that I can understand: I do not understand the use of std :: integer_sequence , nor that of < em> std :: index_sequence , which should be helpful. What I'm trying is a template of this type:
// clase que es una "tupla" de los enteros modulo N
// cada posicion de la tupla puede tener un modulo diferente
template<unsigned N_n,unsigned ... N_nm1>
struct producto_cartesiano_enteros_modulos_Ns {
std::tuple<int_mod_N<N_n>,int_mod_N<N_nm1>...> m_d;
// no hay mas datos miembros
// implementacion ????
};
I appreciate any idea, or tell me somewhere where to see something that will help me. Thanks.