19 Jun
2013
19 Jun
'13
3:13 p.m.
Try boost::distance(rng | filtered(pred)).
Distance works as expected, thanks! On Wed, Jun 19, 2013 at 5:03 PM, Nathan Crookston < nathan.crookston@gmail.com> wrote:
Hi Gonzalo,
Gonzalo Brito Gadeschi wrote:
Someone suggested to use boost::size in the other thread, but size does
boost::end(rng) - boost::begin(rng)
which is not the number of elements in the filtered range.
Try boost::distance(rng | filtered(pred)). Size shouldn't even compile, since it requires random access, and a filtered range cannot be random access.
HTH, Nate
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost