C++ implementation of Strategy Design pattern