
9 Apr
2010
9 Apr
'10
3:48 p.m.
Larry Evans wrote:
What is there about the XPath specification that makes any type hierarchy for modelling it less suitable than using something akin to boost.variant?
You see, I'm wondering because using type hierarchies and virtual functions has been touted as a great advantage of OO programming; yet, it apparently lacks something which you need. I'd like to understand what that is.
Some could argue that the point of a base class is moot if you have to downcast it to make anything useful with it, and that algebraic data types (variant-like things) are a much more elegant solution when you need to visit the different cases.