|
Boost : |
Subject: Re: [boost] [utility] new auto_buffer class --- RFC
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-03-03 17:25:24
Matt Calabrese skrev:
> On Mon, Mar 2, 2009 at 1:04 PM, Thorsten Ottosen <
> thorsten.ottosen_at_[hidden]> wrote:
>> or *obj.begin()[n]. So there are plenty of ways to get a refence into the
>> array.
>
>
> True, though you have the admit that is a bit odd and inconsistent with the
> STL. If someone really wants the optimized returns, I would maybe consider
> having them named differently from those of container concepts but still
> supporting STL-style accessors by default. This way, generic code written
> for standard containers will work with your types.
Well, it has to be generic code that iterates over a const container,
and that tries to store a const reference to an object non-locally via
operator[]. Most generic code is based on iterators, and for *i there is
no problem.
> On Mon, Mar 2, 2009 at 1:04 PM, Thorsten Ottosen <
> thorsten.ottosen_at_[hidden]> wrote:
>
>> Maybe this is a good place to discuss this, but AFAIR,
>> boost::circular_buffer does excatly this.
>
>
> Oh wow, I had no idea. If that's true, I'm a little bit concerned, though if
> it went through review fine maybe I'm just being too pedantic.
I don't know id this was present before the review, or if it was added
later. Any comments, Jan?
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk