Am 17.01.2010 02:11, schrieb Vincent van Ravesteijn:

I guess you need something like :

for (int i = 1; i < number; ++i)
CellData & cs1 = cell_info[row+i][column];

Yes, that's what I need.

I know now the problem but are not familiar with the paragraph code. I
cannot figure out how to write a routine that does what I need. Our
code is often not documented and lines like

for_each(pit, plist.end(),
bind(&ParagraphList::push_back, ref(pl), _1));

don't bother. This is just like:

for (pit = plist.begin(); pit != plist.end(); ++pit)
pl.push_back((*pit))

just copying all paragraphs from plist into pl.

Hmm, why don't we then use the "simple" variant? After looking at the code, I searched our sources for the "bind" command and why it takes an argument named "_1". These searches consume a lot of time and frustrate me. I know that you haven't written this code, it is just a general issue. And complaining just to complain sometimes helps to loose frustration ;-)

> I think in case like
>
>   for_each(pit, plist.end(),
>           bind(&ParagraphList::push_back, ref(pl), _1));
>
> vs
>
>    for (pit = plist.begin(); pit != plist.end(); ++pit)
>           pl.push_back(*pit);
>
> we should always use the plain loop exactly for the reason that it
> is easier to understand as it requires less concepts to be familiar with.

I fully agree.

Can you perhaps help me here?

I hope I did.

Yes, many thanks.

regards Uwe

Reply via email to