Boost logo

Boost Users :

Subject: Re: [Boost-users] transform_iterator causing strange problems
From: Lindley M French (lfrench1_at_[hidden])
Date: 2009-05-28 12:17:53


Ah! That does make sense. Okay, I'll do that.

----- Original Message -----
From: Nat Goodspeed <nat_at_[hidden]>
Date: Thursday, May 28, 2009 6:30 am
Subject: Re: [Boost-users] transform_iterator causing strange problems

> Mathias Gaunard wrote:
>
> > Lindley M French wrote:
>
> >> Okay, that makes sense as a cause, anyway. I'm not clear on how
> to fix
> >> it.
>
> > Well, given the cause is temporaries due to implicit
> conversions, just
> > don't make those implicit conversions.
> >
> > just change
> > const Group& operator()(const std::pair<GroupID, Group> &p) const
> >
> > to
> > const Group& operator()(const std::pair<const GroupID, Group>
> &p) const
>
> The fact that the value of a map iterator does not exactly
> resemble the
> declaration of the map itself (implicit 'const' on the key) has
> bitten
> me more often than I care to admit. I've been trying to cultivate
> the
> habit of always using my_map_typedef::value_type whenever the
> std::pair
> in question comes from a map. So:
>
> const Group& operator()(const OP_map_typedef::value_type& p) const
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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