A C++11 version of the visitor pattern I found from a tutorial