Hello,
 
struct params {
  double field1;
  double field2;
  double field3;
  double fiedl4;
};
 
I would like to generate all the types that hold any combination of the members of params.
 
struct params_field1 {
  double field1;
};
struct params_field2 {
  double field2;
};
struct params_field3 {
  double field3;
};
struct params_field4 {
  double field4;
};
struct params_field1_field2 {
  double field1;
  double field2;
};
struct params_field1_field3 { 
  double field1;
  double field3;
};
struct params_field1_field4 { 
  double field1;
  double field4;
};
struct params_field2_field3 { 
  double field2;
  double field3;
};
struct params_field2_field4 { 
  double field2;
  double field4;
};
struct params_field3_field4 { 
  double field3;
  double field4;
};
struct params_field1_field2_field3 { 
  double field1;
  double field2;
  double field3;
};
struct params_field1_field2_field4 { 
  double field1;
  double field2;
  double field4;
};
struct params_field1_field3_field4 { 
  double field1;
  double field3;
  double field4;
};
struct params_field2_field3_field4 {
 
  double field2;
  double field3;
  double field4;
};
struct params_field1_field2_field3_field4 { 
  double field1;
  double field2;
  double field3;
  double field4;
};
 
There are 15 of these, which is 2^4 -1, where 4 is the number of members in params.
 
Assuming params is adapted as a fusion sequence, this looks doable with PP?
Should I be looking at BOOST_PP_LIST_FOLD_xxx macros?
 
regards,