$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: hongleij_at_[hidden]
Date: 2007-06-27 04:15:07
   //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 Íò ÈË Í¬ ʱ ÔÚ Íæ µÄ ÃÎ »Ã Î÷ ÓÎ