This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Algorithms vs operator* and operator==


chris jefferson wrote:

Therefore, similarily I have 3 options..

1) Make the int, float, etc. case efficent
2) Make the vector, list, etc case efficent
3) Use somethiing like _is_scalar (and perhaps others.. is_pod comes to mind) to try to decide when to make the choice


Any opinions? :)

I would suggest 3) :)


By the way, this is a preliminary list of algorithms taking input_iterators, first candidates for the optimization that I presented at the outset:

replace_copy
replace_copy_if
remove_copy
remove_copy_if
unique_copy
partial_sort_copy
merge
includes
set_*
find_first_of
lexicographical_compare (+, unrelated, specialization for wchar_t?)

Some are "more" candidates than others, either because are very simple - sparing operator* calls can make for a big difference - or because don't have already sets of overloaded helpers (-> the total number of templates would grow very large affecting badly /compile time/ performance! We never discussed this issue in detail, by the way...)

Paolo.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]