Hello,
Tor Didriksen a écrit, Le 20.05.2011 15:52:
> On 2011-05-20 15:17, Guilhem Bichot wrote:
>>> === modified file 'sql/sql_array.h'
>>> --- a/sql/sql_array.h 2011-04-05 07:34:13 +0000
>>> +++ b/sql/sql_array.h 2011-05-19 10:55:07 +0000
>>> @@ -73,6 +73,7 @@ public:
>>> Pops the last element. The returned element must not be used
>>> after the
>>> next update to the array.
>>> */
>>> + // This interface is still wrong!!
>>
>> Sure... but in what sense?
> well, you changed it, but didn't really fix it.
> a pop() should return void, in order to prevent misuse.
>
> your fix disallows writing into the returned element, but clients can
> still read it,
> even after something has been appended to the array.
> they will then be reading the newly pushed element, rather than what
> they popped.
>
> I'm guessing you changed it because you were *writing* into it ?
I think I wasn't writing to it, it's just that when I added pop() I
didn't think about const, then later I thought const was a good addition.
pop() is now void, this is pushed; could you please have a look?
Btw, what about other questions in my mail?