From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2003-01-22 18:05:40


I am trying to use MPL to generate code.

I have a list of types, which I would like to use to call a template
function with arguments that are not dependent on the list.

eg

given:
  template <typename T> void my_function(std::string& s);
  typedef list<int, float, double> my_list;
  std::string s;

what do I write using MPL to generate the equivalent of the following ?

  my_function<int>(s);
  my_function<float>(s);
  my_function<double>(s);

I have looked for code to copy in test/examples/mpl paper and
have not found anything similar to what I need (which doesn't
mean it isn't there somewhere). Any pointers? Is this possible?

Thanks
Hugo