Heres my code:
Code:
class sockclass {
};
class someclass : public sockclass {
};
typedef boost::shared_ptr<sockclass> sockclass_ptr;
void somefunc() {
list <sockclass_ptr> sockets;
for (int i = 0; i < 10; i++)
sockets.push_back( sockclass_ptr(new someclass()) );
list <sockclass_ptr>::iterator p;
for (p = sockets.begin(); p != sockets.end(); p++) {
cout << "data: " << endl;
/*
now if i want access to element in sockclass with p->
i get error: element is not a member of 'boost::shared_ptr<T>
*/
}
}
Please help me, what am I doing wrong?