3 ms·
I agree, but I'd argue that double-indirection isn't really a defining characteristic of the visitor pattern. In fact, I'd argue that the visitor pattern is re
by king_magic 12y ago
I agree, but I'd argue that double-indirection isn't really a defining characteristic of the visitor pattern.
In fact, I'd argue that the visitor pattern is really one of the most "functional" patterns there is.
- TillE 12y agoQuite. It should be obvious how to implement it using std::function and lambdas in C++, for example. Having a bunch of polymorphic classes is an ugly implementation detail, not the essence of the pattern.
- deleted 12y ago[deleted]
- j_jochem 12y agoFrom what they taught me at software engineering 101, double dispatch is exactly the point of the visitor pattern. If your instance of Visitor lacks double dispatch, that means it's just a very complicated way of performing external iteration on Composites.