
Hi,
I would like to have a list(STL) of shared_ptr. The shared_ptr would hold the pointer to the structure "packet_holder" .
struct packet {
int c; union{ struct pkt_header header; struct ip_header ip_hd; }type;
}packet_holder;
list<boost::shared_ptr<packet_holder> > pkt_list;
boost::shared_ptr<packet_holder> pkt(new packet_holder); pkt_list.push_pack(pkt);
Having defined this, I would like to use iterator to iterate through the list. list<boost::shared_ptr<packet_holder> >::iterator it; for(it = list.begin();it != list.end();it++) But I am not able to access the inner details of the struct "packet_holder" using the iterator. it->type.header is not accessible.
Can anyone please suggest me where exactly I might be wrong.
--
With Regards, Manjunath BJ
-- With Regards, Manjunath BJ
-- With Regards, Manjunath BJ