For what it's worth, I reckon the example of Visitor pattern they gave us in the notes is wrong. It's certainly different to what you'll find on "the usual culprits" sites online, with that specialization of the accept() function in the object structure.
If you track the "traditional" examples you'll see they work better. I'm imagining the client would have objects of (super)class Element and Visitor, and these can be assigned pointers to subtypes (by the substitutibility of subtypes, according to our good friend Xiaoping Jia). To the methods of these you just pass the right kind of pointer, in turn. In other words in the client code (as I understand it), you would choose your operation: "Sort" or "BehaveAggressively" etc. (with a generic accept() method) but from there on you can rely on the properly set up Visitor pattern to do the rest for you.
How? Well accept(Visitor* v) always calls the same line: v -> visit(this), so regardless of what this turns out to be you'll be using ordinary old function name overloading when your code scuttles back over to Visitor to scuttle back over to this to do its long-handed operation. You've passed the right parameter in a pretty foolproof way.