|
Boost Users : |
From: Igor Rubinov (igor_rubinov_at_[hidden])
Date: 2008-04-03 11:41:39
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!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net