Is it possible to use template meta-programming to convert any struct or class into a tuple?
For instance:
struct Foo
{
char c;
int
I don't think that there's a way to do this in C++.
I don't know a way to enumerate the fields/types in a struct - if you could do that, I would think that constructing such a tuple would be fairly straightforward.
I believe that Boost.Fusion has a macro that helps with this called FUSION_ADAPT_STRUCT, but that's all manual.
The technical term for this is "reflection", and you can find lots of information about it by searching for "C++ reflection".
Here's one such article: How can I add reflection to a C++ application?