http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50711
--- Comment #3 from Jarryd Beck <jarrydb at cse dot unsw.edu.au> 2011-10-13 03:32:05 UTC --- The following code works: struct Tuple { int a, b, c; }; struct array_get { template <typename T> const T& operator()(const T& t) { return t; } template <typename Array, typename First, typename... Location> auto operator()(const Array& a, First f, Location... loc) // -> typename std::result_of<array_get(decltype(a[f]), Location...)>::type -> decltype(operator()(a[f], loc...)) { return operator()(a[f], loc...); } }; struct Array { int array[5][5][5]; Array() { for (int i = 0; i != 5*5*5; ++i) { reinterpret_cast<int*>(array)[i] = i; } } int get(const Tuple& t) { return array[t.a][t.b][t.c]; } template <typename... Location> //typename std::result_of<array_get(int[5][5][5], Location...)>::type auto get(Location... loc) -> decltype(array_get()(array, loc...)) { return array_get()(array, loc...); } }; int main(int argc, char *argv[]) { Array a; Tuple t{3,4,1}; //return a.get(1,2,3); return a.get(t); }