Boost logo

Boost Users :

Subject: Re: [Boost-users] Assignment of ptr_container<A>::iterator value to ptr_container<B>::iterator variable
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-09-28 12:25:18


Hi Rob,

Den 28-09-2011 17:39, Rob Desbois skrev:
> So I've got a few ptr_container instances floating around, and have
> just tracked down a bug caused by (my) naff code essentially akin to
> the following:
> ptr_vector<int> vi;
> ptr_vector<string> vs;
> bool eq = (vi.begin() == vs.begin());
>
> After digging I discovered the operator in question in void_ptr_iterator.hpp:
> template< class VoidIterT, class T, class VoidIterU, class U>
> inline bool operator==( const void_ptr_iterator<VoidIterT,T>& l,
> const void_ptr_iterator<VoidIterU,U>& r )
>
[snip]
>
> Is there any sensible way to suppress this behaviour, or are there any
> comments on why I might be being a muppet?

We can't fix it until we update the code. I agree it is unfortunate
behavior that we should try to avoid.

I have forgot why I implemented it that way, but I suspect it might have
been to work around
various compiler issues.

Anyway, please file a bug report, and then I'll see if I can fix it.
Or, even better, provide a patch.

kind regards

-Thorsten


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