Extending Temporary buffer for rvalues

Paolo Carlini paolo.carlini@oracle.com
Thu Aug 27 13:40:00 GMT 2009


Hi,
> I wanted to post this patch separate from my other work, as it might
> be controversial (but hopefully isn't).
Frankly, I think we should instead take the occasion to revisit this
_Temporary_buffer idea, as indeed you pointed out earlier. I'm not
saying we should do away with it, or drastically simplify it, but, for
example, I never really, fully understood why we should fill with
*__first instead of something else, what's so special about it? As far
as I can see, *__first works now as a sort of replacement for
value_type(), just because we can't assume default constructible. Also,
from the correctness point of view, I'm nor convinced that /moving/
*__first is always correct: after the construction of _Temporary_buffer
__first is passed around in the algorithms and thus apparently assumed
meaningful. To be honest I also don't like the nested try / catch would
be the only case in the whole library, I think. All in all, I think we
should see things in a different way...

Paolo.



More information about the Libstdc++ mailing list