
Hi, I'm new to MPL and I have difficulties to use the map container. I need to map (and then retrieve) some types based on they ID: I try the following code but it does not work.. sturct MSG_METHOD_CONNECT { .... } template<class MESSAGE> class PBMessage { public: PBMessage() {}; /* ... other methods ... */ private: MESSAGE m_Msg; }; // Map of types. The key is the Message opCode typedef typename mpl::map< mpl::pair<mpl::int_[100], PBMessage<MSG_METHOD_CONNECT> >, mpl::pair<mpl::int_[101], PBMessage<MSG_EVENT_CONNECT> >, > TMessageMap; // The Message type template < typename MessageMap, int opCode > typedef typename mpl::at<MessageMap, mpl::int_<opCode> >::type::value TMessage; And to retrieve the type: TMessage<TMessageMap, opCode> msg; Could someone give me some suggestions? Regards, Daniele.