
Kim Kuen Tang wrote:
You can use push_back from phoenix to fill in your data type. See http://www.boost.org/doc/libs/1_42_0/libs/spirit/phoenix/doc/html/phoenix/co...
Perhaps you can show us your data type so we can go into detail.
I'm talking about the LLSD class: http://svn.secondlife.com/trac/linden/browser/trunk/indra/llcommon/llsd.h I'm confused by your answer, though, so I probably asked the question badly. I'm looking for something equivalent to this pseudocode: template <typename CALLABLE> typename boost::function_traits<CALLABLE>::result_type apply(const CALLABLE& callable, const LLSD& args) { // 'args' is already filled // for present purposes, assume we know it contains an array // call 'callable', supplying its args from that array if (boost::function_traits<CALLABLE>::arity == 0) { return callable(); } if (boost::function_traits<CALLABLE>::arity == 1) { return callable(args[0]); } if (boost::function_traits<CALLABLE>::arity == 2) { return callable(args[0], args[1]); } // ...etc. to some max arity... } I could possibly write such code, using partial template specialization on boost::function_traits<CALLABLE>::arity instead of a sequence of 'if' statements. My point is that I assume Boost already contains something like this. I'm just not sure where to look. Thanks for any pointers to the appropriate documentation.