A labyrinth solver using C++ generic programming