[PATCH][libstdc++-v3 parallel mode]
Benjamin Kosnik
bkoz@redhat.com
Wed Nov 14 16:16:00 GMT 2007
This is fine.
> + for (int t = 0; t < k; t++)
> + {
> + if (stable)
> + {
> + if (seqs_begin[t].first == seqs_begin[t].second)
> + lt.insert_start_stable(*arbitrary_element, t, true);
> + else
> + lt.insert_start_stable(*seqs_begin[t].first, t, false);
> + }
> + else
> + {
> + if (seqs_begin[t].first == seqs_begin[t].second)
> + lt.insert_start(*arbitrary_element, t, true);
> + else
> + lt.insert_start(*seqs_begin[t].first, t, false);
> + }
> }
Code like this (and other parts of this file) makes me
think that this loop could be peeled via a template parameter on
the function (or lt object), and structure the code for this function as
a stable/notstable specializations (ie, stable policy). (or as
stable/non-stable specializations of LT.)
Just a thought.
It would probably be a lot cleaner.
-benjamin
More information about the Libstdc++
mailing list