Boost logo

Boost Users :

From: Nico Galoppo (nico_at_[hidden])
Date: 2006-02-23 00:47:28


Hi,

I have a class with some custom iterators, I would like to add another custom
iterator that is a 'filtered' version of the custom iterator. Something like this:

class A
{
public:
   typedef boost::filter_iterator<predicate_type, custom_iterator>
filtered_iterator;

   filtered_iterator begin()
   {
     predicate_type predicate = boost::bind(...);
     return boost::make_filter_iterator(predicate, custom_begin(), custom_end());
   }
}

Unfortunately, the following code doesn't compile:

A a;
A::filtered_iterator it = a.begin();

Reason: cannot convert from 'boost::filter_iterator<Predicate,Iterator>' to
'const boost::filter_iterator<Predicate,Iterator>'

I can give more compiler output if needed.

Thanks!

--nico

-- 
nico galoppo von borries     @  address: 105 creel st., chapel hill
comp. graphics phd. student  @           north carolina, 27516 USA
UNC, chapel hill             @  phone: +1 (919) 962-1898 (office)
                              @         +1 (919) 942-7609 (home)
                              @  email: nico at cs dot unc dot edu
                              @  homepage: http://www.cs.unc.edu/~nico
--- debian linux :: vim powered

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