In a previous post, Johan explained us how he managed to get the visitor design pattern to work without having to redefine visitable methods in the visitor base class. This is quite interesting for some reasons :
- This is the edge of C++ programming, few know how to use templates like this,
- The choice of the method to execute is done at compile time, avoiding the runtime type checking implied with the Reflective version and this is good for speed of code execution.
However, there are a few issues. The Meta Visitor does not handle passing parameters like the Reflective one does. Even if it did, I expect the templated code to dramatically increase to a point where a normal human beeing is having a hard time reading it, along with giving a really hard time for the compiler to get to the end of it...
Anyway, I'm pretty confident about Johan ending up with a longer blog with a solution to this issue. (No stress Proppy, really :))
I'm a pragmatic developer, I try to consider all the aspects of the development and I tend to prefer readability over technically challenging code. But there's a place for everyone and researchers are here to make things go further away... Go, Go, Go proppy ;)