An implementation of horspool's algorithm in c++