Boost logo

Boost Users :

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 Íò ÈË Í¬ ʱ ÔÚ Íæ µÄ ÃÎ »Ã Î÷ ÓÎ



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