Namespaces
Variants
Views
Actions

Talk:cpp/algorithm/search n

From cppreference.com

The possible implementation here does not look correct. First, if the range is smaller than 'count', then 't_last' will not be correct. Also, in the inner loop, there is no guarantee that 'first' doesnt go past 't_last' but not return, and then the outer for-loop will not exit correctly. -- jaredgrubb

I agree that it looks a little funny. Would you like to take a whack at fixing it? :) --Nate (talk) 20:20, 7 September 2013 (PDT)
Sure and I hope it's right now; at the very least, it no longer has those defects :) Jaredgrubb (talk) 09:14, 8 September 2013 (PDT)