13 Aug
2010
13 Aug
'10
10:46 p.m.
On Fri, Aug 13, 2010 at 2:27 PM, Kenny Riddile
Say I have an array:
ArgumentType arguments[ argumentCount ];
where argumentCount is a size_t template parameter.
I would like to generate, at compile time, a comma-delimited list of the form:
arguments[0], arguments[1], arguments[2], ...arguments[argumentCount-1]
Can this be accomplished using Boost.Preprocessor or by some other method?
It 'could' be done using the preprocessor, but you would have to encode the size at the call site since the preprocessor knows nothing of the C type system. If you can get the arguments type to be boost::array or fusion::vector or so, then fusion::invoke would be perfect if you are needing to call something with them.