Here the vector is const but the pointer can still be changed. If this is not intended, returning boost::shared_ptr<const DataProcessing> should be done. Note: Conversion from vector<shared_ptr<DataProcessing>> to vector<shared_ptr<const DataProcessing>> can only be done with a reinterpret_cast and should be centralized as a function like constifyVecPointers().