J
jimxoch
Dear list,
I have recently implemented a generic sequence searching template
function, named single_pass_search, which is more generic than
std::search and has better worst case complexity at the same time.
More specifically, the main advantage of the single_pass_search over
the std::search is its capability to search for a sub-sequence in a
search-range that is accessed through a pair of single-pass (input)
iterators, while std::search requires that the search-range must be
accessed via forward iterators at least. This practically means that
single_pass_search can for example search a file directly through a
pair of istream iterators, without requiring the interference of an
intermediate container. (Please see "http://www.codeproject.com/KB/stl/
single_pass_search.aspx" for more.)
Although, I believe that single_pass_search can probably be
interesting in theory, I still have some doubts regarding its
practical usefulness to the average C++ developer. Hence, I would be
really grateful to anyone that will express his opinion regarding the
single_pass_search usefulness. Please don't try to be nice to me, I
need real feedback, however some reasoning together with your opinion
would be very welcomed.
Thank you very much,
Jim Xochellis
I have recently implemented a generic sequence searching template
function, named single_pass_search, which is more generic than
std::search and has better worst case complexity at the same time.
More specifically, the main advantage of the single_pass_search over
the std::search is its capability to search for a sub-sequence in a
search-range that is accessed through a pair of single-pass (input)
iterators, while std::search requires that the search-range must be
accessed via forward iterators at least. This practically means that
single_pass_search can for example search a file directly through a
pair of istream iterators, without requiring the interference of an
intermediate container. (Please see "http://www.codeproject.com/KB/stl/
single_pass_search.aspx" for more.)
Although, I believe that single_pass_search can probably be
interesting in theory, I still have some doubts regarding its
practical usefulness to the average C++ developer. Hence, I would be
really grateful to anyone that will express his opinion regarding the
single_pass_search usefulness. Please don't try to be nice to me, I
need real feedback, however some reasoning together with your opinion
would be very welcomed.
Thank you very much,
Jim Xochellis