
Hi, now I have a new problem - const correctness. ---8<--- #include <iostream> #include <algorithm> #include <iterator> #include <vector> #include <boost/shared_ptr.hpp> class Doc { public: virtual ~Doc() { } public: const std::vector<double>& foo() const { return m_foo; } protected: std::vector<double>& foo() { return m_foo; } private: std::vector<double> m_foo; }; using namespace std; int main() { boost::shared_ptr<Doc> lp_doc( new Doc ); std::copy(lp_doc->foo().begin(), lp_doc->foo().end(), std::ostream_iterator<double>(cout, " ") ); cout << endl; } --->8--- `std::vector<double, std::allocator<double> >& Doc::foo()' is protected I hoped std::copy takes the const foo() member function. Thanks olaf