On Fri, Jan 06, 2017 at 08:42:15AM -0600, Aditya Kumar wrote: > Yes, we do. > Sorry for the mistake, it happened because I first wrote this for > libcxx (https://reviews.llvm.org/D27068) and while porting that line > got missed.
Shouldn't find at least in the case where it is narrow char string just use C library memmem? That implements a Two-Way searching algorithm with some improvements from Boyer-Moore. Otherwise, consider what even your modified version will do for #include <string> int main() { (std::string(10000000, 'a')+"b").find(std::string(1000000, 'a')+"b"); } Or does the C++ library need to reinvent everything implemented in the C library? Jakub