15 Aug
2006
15 Aug
'06
7:14 p.m.
Hi there, just trying to figure out how to put together a tuple type at compile type? Please consider the following code: struct s1 { static const int num_values = 1; int i; }; struct s2 { static const int num_values = 2; int i; int j; }; struct s3 { static const int num_values = 3; int i; int j; int k; }; template< class S > void create_tuple( S s ) { /// create tuple_type map< tuple_type, unsigned int > map; map[ make_tuple( s ) ] = 99; } The template parameter S will only be one of above defined structs. Clearly, I need to loop over S::num_values to create the tuple type. But how do I do that? Thanks ahead, Christian