There is a tuple implementation given here.
While the code compiles with gcc 4.8, with clang 3.5 it gives the following error: "expected expression" for the line return tail.get<M-1>();
I can't figure out what is wrong with the code and the error is not clear as to what is wrong.