|
Boost Users : |
Subject: Re: [Boost-users] Boost.Ranges 2.0 algorithms accepting a const reference
From: Neil Groves (neil_at_[hidden])
Date: 2010-07-12 19:13:02
On Sun, Jul 11, 2010 at 5:37 PM, Stefano <pelux_at_[hidden]> wrote:
>
> > You are entirely correct. The reverse function is missing the const
> overload,
> and this will cause a problem when returning a temporary to a constant
> range
> that has mutable elements. A workaround, which I expect you have already
> thought
> of, would be to hold a const reference to the range in a variable and pass
> this
> into reverse.I shall put a correction into the trunk as soon as possible. I
> shall also review all of the algorithm functions for similar mistakes.I
> apologize for my oversight and for any inconvenience this has caused.
>
> The correction to the temporary lifetime issues is committed to the trunk
along with a lot of new test cases. This has introduced some regressions for
compilers that can't seem to pick the appropriate const versus non-const
overloads. I am working on removing the regression while preserving the
capability of working with temporaries.
I hope this helps.
Regards,
Neil Groves
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