On Monday 17 October 2011 13:10:40 ext Thiago Macieira wrote:
> Let's call this one option 0:
>
> > > Here's an idea:
> [...]
> However, the calculation of the beginning of the data pointer now involves a
> comparison:
> T *data()
> {
> if (d->isRawData()) return d->rawData()->offset;
> return d->array() + d->begin;
> }
If that's used inside the at()/operator[]() that might be a problem.
IMNSHO anything that's called a "proper solution" has compile to
at most four instructions in the inner loop in code like
Container<int> c(100);
for (int i = 0; i != 100; ++i)
c[i] = 42;
(including the jump) at on x86 and ARM. That's what the naive way
to write the loop produces with gcc for std::vector. There's no need
to provide anything that's worse.
Andre'
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback