
16 Apr
2004
16 Apr
'04
7:43 p.m.
Debian User <greened@obbligato.org> wrote:
Suppose I have a number of types that each have a "value" enum, much like MPL's constant classes. Now suppose that I want to construct a runtime-indexable array of those values, according to the position of each type in an MPL vector.
For example:
int values[3];
typedef boost::mpl::vector_c<int,10, 11, 12> values;
typedef some_magic_metafunction<values>::type runtime_function;
// values[0] = 10, values[1] = 11, values[2] = 12 runtime_function::fill_array(values);
[...] Please see http://tinyurl.com/3ccex for a documented example and http://tinyurl.com/2q7hl for the compliable code along the lines of what you need. HTH, -- Aleksey Gurtovoy MetaCommunications Engineering