On Mon, Dec 10, 2007 at 06:16:05AM +0000, Angus Leeming wrote: > You might define a preprocessor macro to perform the drudgery for you. > Perhaps > something like: > > #define LYX_BUILD_VECTOR(LYX_CARRAY, LYX_VECTOR) \ > { \ > if (LYX_CARRAY != 0 && LYX_CARRAY[0] != 0) \ > { \ > std::size_t const size = sizeof(LYX_CARRAY) / sizeof(LYX_CARRAY > [0]); \ > LYX_VECTOR = std::vector<string>(LYX_CARRAY, LYX_CARRAY + > size); \ > } \ > } > > char const * const known_fontsizes_array[] = { "10pt", "11pt", "12pt" }; > vector<string> known_fontsizes; > LYX_BUILD_VECTOR(known_fontsizes_array, known_fontsizes); > > Dunno off the top of my head how to make a macro to initialize the vector > though...
So maybe the macro is not the best idea after all. Andre'