I flagged this answer as not-an-answer because it says nothing more than "variadic templates are involved", which is not a sufficient answer (note that the real answer, above, is actually fairly complex and even somewhat surprising, even with variadic templates--and that real implementations of tuple
are actually pretty complicated!).
My flag is marked as "disputed." Is this "answer", which amounts to little more than "it's trivial, google [related thing]", actually an answer? Sure, this would be helpful as a comment (since variadic templates are indeed a crucial part of the implementation)--but the contribution of "variadic templates are involved" obvious anyway, since the type of tuple
is itself a variadic template.
I realize that "not an answer" flags are displayed to mods without showing the original question, but I can't imagine how "it's trivial, google [related thing]" could ever be a valid answer.
Finally, just as evidence that the answerer really isn't helping OP (even though strictly speaking that shouldn't be relevant for the "not an answer" flag), note this statement from the original question: "I tried to read description in libstdc++ manual and then read template listing, but it's really hard to understand how it works, especially when reading code." Responding to this with "it's trivial" is practically an insult.
EDIT: I overestimated how meaningful the "disputed" dismiss-reason is; see Air's answer. I still don't think this is really an answer, but at least the flag wasn't declined.
std::tuple
uses variadic templates" is a (possibly crappy) answer even when stripped of the link.