2013/8/17 firespot
Hi,
Consider the following task: Given a -) pointer to a function, and -) an iterator range with elements of type void *, the function-ptr shall be called with all the elements in the range as arguments.
So conceptionally something like this:
template
void make_call(Func, Iter begin, Iter end) { int n = std::distance(begin, end); (*Func) (*(begin), *(begin + 1), *(begin + 2), ..., *(begin + n - 1)) } The interface (function declaration) here is +- what I want, the implementation shown of course is dummy-code not working. Does boost provide a more or less easy way to get this implementation smoothly done? C++ is 2003 version, so code must be compatible with e.g. VS 2008.. Note that I would know in principle a way how to do implement it myself, which involves the creation of a separate class for each number of arguments, but that's precisely what I want to avoid and I hope that wheel has already been invented in some boost-library :)
It'll be much easier if the iterator is Fusion iterator, do you really need dynamic-ranged args for a member function? What if the size mismatched? to fill with null args?