I used C before (embedded stuff), and I can initialize my arrays like that:
int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 };
i
hm, you should use std::fill_n() for that task...
as stated here http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html the designated inits (extention) are not implemented in GNU C++
edit: taken from here: initialize a const array in a class initializer in C++
as a comment said, you can use std:vector to get the result desired. You could still enforce the const another way around and use fill_n.
int* a = new int[N];
// fill a
class C {
const std::vector v;
public:
C():v(a, a+N) {}
};