
14 Apr
2004
14 Apr
'04
4:23 p.m.
"Gennaro Prota" <gennaro_prota@yahoo.com> wrote (snip about negative index in operator[] )
b[i] with i<0 would give: b[sz - ((-i) % sz)] where sz = b.size()? [Note that this gives undefined behavior when the absolute value of i is a multiple of sz] Is there a motivating case for this? My fear is that it slows down operator[].
b[i] with i<0 would give: b[b.size() - (-i)] Some language (forgot name) provides such feature. I feel unless it is adopted by all random access containers in Boost it should not be implemented for single case. /Pavel