strategy pattern c++ - Search