I've been doing quick-and-dirty dynamic_casts on objects of the Value classes, when I know that the result should be a string or int or whatever. Let's not do this, the performance is so bad.
Either:
implement double dispatch, like we do with DataTypes, and just throw an exception if we try to do something on the wrong type
the functionality we want is probably pretty lightweight, so maybe we don't need to go through the trouble of implementing an entire visitor pattern here. Although this might change if I decide to put the CompositeValue and ArrayValue concepts back in.
Just use enums to differentiate between classes. Check the enum first, then do whatever unsafe cast we need to get to the right pointer type and go from there.
I've been doing quick-and-dirty dynamic_casts on objects of the Value classes, when I know that the result should be a string or int or whatever. Let's not do this, the performance is so bad.
Either: