[patch] Make vector::at() assertion message more useful (try #2)

Paolo Carlini paolo.carlini@oracle.com
Wed Sep 4 23:26:00 GMT 2013


Hi,

On 09/04/2013 10:53 PM, Paul Pluzhnikov wrote:
> I am not at all sure the names I choose here are good ones. Suggestions
> welcome.
For sure concat_size would not be Ok, isn't uglified. Thanks for the 
code, you understand isn't really something we can imagine committing.
> I also shudder at the idea of repeating _M_range_check code in
> e.g. string::at(), and elsewhere. Perhaps we need a snprintf_lite, that
> only understands '%zu' and literal characters, e.g.:
>
>    snprintf_lite(__s, sizeof(__s),
>                  _N("vector::_M_range_check: __n (which is %zu) >= "
>                     "this->size() (which is %zu)"), __n, this->size());
That seems worth exploring, I agree.

Paolo.



More information about the Libstdc++ mailing list