Hello,
 
This is kind of newbie question. Any help would be greatly appreciated :).
 
I'd like to map (SourceClass_i) list to (DestClass_i) list in the way that for any instance of SourceClass_i passed to the mapping expression, an instance of DestClass_i will be created and the result of the expression would be of type DestClass_i.
 
I defined the mapping as follows:
 
typedef mpl::map<
 mpl::pair<SourceClass1, DestClass1>,
 mpl::pair<SourceClass2, DestClass2> //, etc...
> source2dest;
 
Now I guess I have to take the result of mpl::at<source2dest, SourceClass> and apply kind of:
 
template<typename DestClass> struct Creator
{
  static DestClass create()
  {
    return *new DestClass;
  }
};

...but unfortunately the things don't come together.
 
Thank you in advance!


Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!