Boost logo

Boost Users :

From: Sebastian Weber (sebastian.weber_at_[hidden])
Date: 2006-04-07 03:17:32


Hi!

> It shouldn't. Implicit conversions are generally dangerous; there's
> no good reason to allow one here.

Well, that might be in general the case. But at least in my case I think
it does make sense: random_set_iterator is basically a
std::vector<>::iterator with the noteable difference that the
next-operation ++ is replaced by a function which moves the iterator to
a random element in within the vector. And as I do want to delete
elements from the vector which I find by the random-iterator, I need the
conversion.

>
> > I'm sure, it should not hard to
> > implement somthing like this, but how?
>
> You can easily add an
>
> operator base_iterator_type() const
>
> to random_set_iterator, but we (the authors of iterator_adaptor) don't
> recommend it.

Thanks, that did it.

Greetings,

Sebastian Weber

>


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