Boost logo

Boost Users :

Subject: Re: [Boost-users] [range, iterator?] compiler error going from 1.34 to 1.37
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-19 14:32:41


AMDG

Martin Livesey wrote:
>
> We are upgrading our legacy code to use boost 1.37 from version 1.34
> and have hit a slight hitch. The following (massively simplified) code
> no longer compiles. I tried it on more than one compiler and the error
> messages aren’t too useful in helping to determine the issue. (The
> target compiler will be VS 2k8). Any assistance would be appreciated.
>
> Thanks in advance.
>
>
> class B {
>
> public:
>
> typedef std::list<A>::iterator iterator;
>
> };
>
>
> getFilteredRange<C>(new B).size();
>

size requires random access now. Use distance instead

#include <boost/range/distance.hpp>
boost::distance(getFilteredRange<C>(new B));

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net