Thank you for your answer. This kind of thing also works for C++, but that would mean that I would implement the whole visitor twice - one const and one non-const version. Is that really the only way? Can't I tell the D compiler that "the argument of that lambda shares the const-ness of the current object"?

D offers "inout"; this actually aims into the right directing, but I guess it does not help here.

Is there any "static if"-something construct to check the const-ness of an object?

Reply via email to