> having the dynamic cast from the caller

/me cannot understand. This functions performs a recursive search on the tree pointed by 'root' (thus nodes can be of any type). I do not see how you can perform the dynamic_cast from the caller. Consider:

var a[5]
var b[5]

a = b + [1, 1, 1, 1, 1]

This translates to (simplified):

```
                  AssignmentNode
               |                 |
MemoryVectorNode (a)      BinaryArithmeticNode(+)
                            |                   |
                MemoryVectorNode(b)            [1,1,1,1,1]
```

Thus, when expanding the AssignmentNode, the rhs is not directly a MemoryVectorNode, but can be anything. As a consequence, the dynamic_cast cannot be done from the caller, but it has to be done from inside the recursive search. For the same reason, we cannot put this function as a member of MemoryVectorNode only. We could put it as a private member of AssignmentNode, but it may be useful for other classes in the future to test part of a subtree. I see it more like a toolbox.