Boost logo

Boost Users :

Subject: [Boost-users] indirect_iterator,symmetric_matrix and ptr_vector
From: Archie14 (admin_at_[hidden])
Date: 2009-05-27 06:57:20

Following test fails to compile. Errors start with the first call to
make_indirect_iterator. On the first glace on the error output it looks that
indirect_iterators cannot be used together with ptr_vector and matrix. Is that
correct? If I need to calculate the sum of all matrices in a vector - what is
the right way to do it?

void test()
        typedef symmetric_matrix<double, lower> matrixofdoubles;

        boost::ptr_vector<matrixofdoubles> lst;
        boost::make_indirect_iterator(lst.begin()); // testing ind.iter.

        matrixofdoubles totalsum (10);
                totalsum, std::plus<matrixofdoubles>());

Errors are:
c:\Libraries\boost\boost_1_39_0\boost/pointee.hpp(30) : error
C2039: 'element_type' : is not a member
of 'boost::numeric::ublas::symmetric_matrix<T,TRI>'
        c:\Libraries\boost\boost_1_39_0\boost/mpl/eval_if.hpp(41) : see
reference to class template
instantiation 'boost::detail::smart_ptr_pointee<P>' being compiled
        c:\Libraries\boost\boost_1_39_0\boost/pointee.hpp(69) : see reference
to class template instantiation 'boost::mpl::eval_if<C,F1,F2>' being compiled

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