Boost logo

Boost Users :

Subject: [Boost-users] boost::shared_ptr with operator[]
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-09-26 14:50:05


I'm using boost::shared_ptr, my class overloads the operator[]. How can I access to an element of a shared pointer?
class myclass {
   public :

boost::shared_ptr<myclass> x( new myclass );

How can I get an access to the [] operator? I have tried it with
(*x)[5] but I'll get a "segmentation fault" error



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at