Line 20: You've declared cd() as const. That's telling the compiler you won't modify any member variables of the Path instance. Line 34 tries to change a member variable of the instance.
Since cd() logically changes the currentPath, you probably don't want cd() to be const.
It's poor etiquette to remove your question after it has been answered. By doing this, you minimize the chances of helping anyone else who encounters a similar problem.