is something seriously wrong with zero_vector?

I noticed that creating a zero_vector with some size, and then iterating over it produced strange results. Then I noticed this: BOOST_UBLAS_INLINE const_iterator begin () const { return const_iterator (*this); } BOOST_UBLAS_INLINE const_iterator end () const { return const_iterator (*this); } Excuse me? Doesn't this mean begin() == end() and effectively size is always zero?

#include <boost/numeric/ublas/vector.hpp> #include <iostream> #include <iterator> int main() { boost::numeric::ublas::zero_vector<double> v (10); std::copy (v.begin(), v.end(), std::ostream_iterator<double> (std::cout, " ")); } This prints _nothing_. Is this the expected behavior? I expected 10 '0's.
participants (1)
-
Neal Becker