
20 Apr
2006
20 Apr
'06
1:44 p.m.
Marcin Kalicinski wrote:
But the key point is: the function that uses a path string also knows which separator it intended to use in its notation. Storing the separator as a property of the tree goes against encapsulation.
Additionally, it is not very feasible. You have to remember that tree is a recursive structure. How do we make sure that all nodes contain the same default separator?
Why does the tree even care what the separators are? Do you store full paths to each node? IMO, as I've stated elsewhere in this thread for other reasons, there is a need for a separate path class/concept. A path could have constructor taking a string and an optional separator. The path would expose iterators ala boost::filesystem. Jeff Flinn