Re: [PATCH] refactor Vector

2014-02-10 Thread Kinkie
On Sun, Feb 9, 2014 at 2:08 AM, Alex Rousskov rouss...@measurement-factory.com wrote: On 02/08/2014 03:44 PM, Kinkie wrote: And I don't see how to reliably get to vector[0] in pre-11 STL. Do you have any clue? My understanding is that you just do vector_object[0], but I have not tested

Re: [PATCH] refactor Vector

2014-02-10 Thread Kinkie
The kind of cast appears to be wrong here: Const_cast is normally used to remove const, not add it. It is not used to change the type. It is currently a c-style cast. Attributes is built over push_back(), so the only way to cleanly make it const would be to copy it after it's built. Without it,

Re: [PATCH] refactor Vector

2014-02-10 Thread Alex Rousskov
On 02/10/2014 02:20 AM, Kinkie wrote: The kind of cast appears to be wrong here: Const_cast is normally used to remove const, not add it. It is not used to change the type. It is currently a c-style cast. Attributes is built over push_back(), so the only way to cleanly make it const would

Re: [PATCH] refactor Vector

2014-02-10 Thread Kinkie
On Mon, Feb 10, 2014 at 5:16 PM, Alex Rousskov rouss...@measurement-factory.com wrote: On 02/10/2014 02:20 AM, Kinkie wrote: The kind of cast appears to be wrong here: Const_cast is normally used to remove const, not add it. It is not used to change the type. It is currently a c-style cast.

Re: [PATCH] refactor Vector

2014-02-08 Thread Kinkie
On Fri, Feb 7, 2014 at 6:32 AM, Alex Rousskov rouss...@measurement-factory.com wrote: On 02/04/2014 12:57 PM, Kinkie wrote: On Sun, Feb 2, 2014 at 10:42 PM, Amos Jeffries squ...@treenet.co.nz wrote: On 2014-02-03 08:06, Kinkie wrote: Hi, the attached patch (merge from

Re: [PATCH] refactor Vector

2014-02-08 Thread Alex Rousskov
On 02/08/2014 03:44 PM, Kinkie wrote: And I don't see how to reliably get to vector[0] in pre-11 STL. Do you have any clue? My understanding is that you just do vector_object[0], but I have not tested that. Cheers, Alex.

Re: [PATCH] refactor Vector

2014-02-06 Thread Amos Jeffries
On 5/02/2014 8:57 a.m., Kinkie wrote: On Sun, Feb 2, 2014 at 10:42 PM, Amos Jeffries squ...@treenet.co.nz wrote: On 2014-02-03 08:06, Kinkie wrote: Hi, the attached patch (merge from lp:~squid/squid/vector-refactor) is an attempt to refactor Vector and its clients so that: - clients of

Re: [PATCH] refactor Vector

2014-02-06 Thread Alex Rousskov
On 02/04/2014 12:57 PM, Kinkie wrote: On Sun, Feb 2, 2014 at 10:42 PM, Amos Jeffries squ...@treenet.co.nz wrote: On 2014-02-03 08:06, Kinkie wrote: Hi, the attached patch (merge from lp:~squid/squid/vector-refactor) is an attempt to refactor Vector and its clients so that: - clients of

Re: [PATCH] refactor Vector

2014-02-04 Thread Kinkie
On Tue, Feb 4, 2014 at 2:17 AM, Alex Rousskov rouss...@measurement-factory.com wrote: On 02/02/2014 02:42 PM, Amos Jeffries wrote: in src/HttpHdrRange.cc * This pattern happens several times throughout this patch: -while (!specs.empty()) -delete specs.pop_back();

Re: [PATCH] refactor Vector

2014-02-03 Thread Alex Rousskov
On 02/02/2014 02:42 PM, Amos Jeffries wrote: in src/HttpHdrRange.cc * This pattern happens several times throughout this patch: -while (!specs.empty()) -delete specs.pop_back(); +while (!specs.empty()) { +delete specs.back(); +

Re: [PATCH] refactor Vector

2014-02-02 Thread Amos Jeffries
On 2014-02-03 08:06, Kinkie wrote: Hi, the attached patch (merge from lp:~squid/squid/vector-refactor) is an attempt to refactor Vector and its clients so that: - clients of Vector don't break layering - the Vector API more closely matches std::vector The eventual aim is to replace Vector