This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] libstdc++/19495
Benjamin Kosnik wrote:
> * include/ext/array_allocator.h: Tweak slightly, avoid assuming
> the existence of an _Array::begin() member.
>
>It's my preference to keep _M_array->size(), and _M_array->begin()
>function calls in there please. When we have concepts, I'll add these
>bits as a requirement. OK?
>
>
I should have explained the issue better: while, IMHO, this is also a
not-so-bad generalization, it's needed in order to fix this problem,
due, again to the allocator rebind + copy-constructor issue. If I don't
change array_allocator, the array_allocator testcases don't even
compile. So...
>Anyway.
>
>Any chance you can make a bugzilla entry about the array_allocator
>rebind problem? It would be good if this issue does not get lost.
>
>
Sure.
>I like the v7 solution for this better. However, for so 6 this seems completely appropriate.
>
>;)
>
>
;) Yes, in v7, provided we want to avoid reference-counting, we can just
allocate memory for the string chars proper, everything is
straightforward. There are a few other performance/correctness issues,
in that case: 1- The need for a "mini-string" in the standard exception
classes, as recently discussed with Kanze and Gaby too; 2- A form of
simulated move-semantics will be welcome, in order to keep the best of
reference-counting, so to speak, when temporaries are involved.
Paolo.