I have a problem with duplication of identical code for const and non-const versions. I can illustrate the problem with some code. Here are two s
const
Another solution - require the Visitor class to have a metafunction that adds const when it applies:
Visitor
template static void visit(Visitor &v, typename Visitor::ApplyConst::Type &a) { v(a.i); v(a.d); }