I was playing around with variadic templates (gcc 4.5) and hit this problem :
template <typename... Args>
boost::tuple<Args...>
my_make_tuple(Args... args)
{
return boost::tuple<Args...>(args...);
}
int main (void)
{
boost::tuple<int, char> t = my_make_tuple(8, 'c');
}
GCC error message :
sorry, unimplemented: cannot expand 'Arg ...' into a fixed-length argument list
In function 'int my_make_tuple(Arg ...)'
If I replace every occurrence of boost::tuple by std::tuple, it compiles fine.
Is there a problem in boost tuple implementation? Or is this a gcc bug ?
I must stick with Boost.Tuple for now. Do you know any workaround ?
Thanks.
It doesn’t seem to like expanding
Args...toT1, T2, T3, ..., T9as Boost has it.As a workaround, use constructs that don’t require this expansion:
Another option might be to do the expanding manually, seeing that
boost::tuplesupports up to 10 arguments.