Magnus Vaikla wrote:With all these members, it'd be a pain to write functions for all of them. Is it a good idea (given it's possible) to make a single get/set function for all of the members? If so, then how?
Considering that all of your members are ints, how about using an array instead? And the members are just different elements of the array? With this option, the get/set will take an additional index parameter.
If that is not possible, meaning you want to keep the original member names, then how about a union with the array? Or just use pointer arithmetic from the first member of the class -- basically use it as an array?
Henry