strategy pattern in c++