
AMDG Igor Rubinov wrote:
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
, mpl::pair //, etc... source2dest;
Now I guess I have to take the result of mpl::at
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!
How do you intend to use this.
Creator