
27 Jun
2007
27 Jun
'07
2:15 a.m.
//boost #include <boost/multi_index_container.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/member.hpp> using namespace ::boost; using namespace ::boost::multi_index; #include <string> struct Peer { std::string userid; }; struct CPeer:public Peer { int index; }; struct userid{}; typedef multi_index_container< CPeer, indexed_by< hashed_unique<tag<userid>,member<CPeer,std::string,&CPeer::userid> >
CPeersType;
//how could i use userid as an index in CPeer ,not in Peer, 一 起 来,150 万 人 同 时 在 玩 的 梦 幻 西 游