Hello,
here is my problem: I have a complex data type, like a std::vector<
std::string > and need some global constant values of this type. The
type is also used non-constant throughout the program, so I do not want
to use dumb types, but rather STL things.
In the best of worlds, initialization of these constants would not
happen at runtime, but at compile time, essentially generating a
constant memory image of this type via meta-programming. Has anyone
made any attempts in this direction?
I have written some simple macros that do it in Visual C++ 2005 for
std::vector< integral_type >. Of course, it is non-portable, but the
general principle _would_ be portable, with merely the exact memory
arrangement to be non-portabel.
Any ideas?
Arno
here is my problem: I have a complex data type, like a std::vector<
std::string > and need some global constant values of this type. The
type is also used non-constant throughout the program, so I do not want
to use dumb types, but rather STL things.
In the best of worlds, initialization of these constants would not
happen at runtime, but at compile time, essentially generating a
constant memory image of this type via meta-programming. Has anyone
made any attempts in this direction?
I have written some simple macros that do it in Visual C++ 2005 for
std::vector< integral_type >. Of course, it is non-portable, but the
general principle _would_ be portable, with merely the exact memory
arrangement to be non-portabel.
Any ideas?
Arno
Comment