
1 Feb
2004
1 Feb
'04
4:47 p.m.
Beman Dawes wrote:
Equality --------
The path relational operators will be defined purely in terms of string comparison between the textual representation of the two paths. There are two ways to do this: (1) string comparison using std::string relational operators or (2) string comparison using std::lexicographical_compare.
I'm not not entirely sure that I understand you correctly but I think that you mean p.string() < q.string() vs lexicographical_compare( p.begin(), p.end(), q.begin(), q.end() ) (equivalent to p.m_name < q.m_name). There are two reasons to prefer lexicographical_compare. First, container requirements. Second, consider the case where p is { "first/", "second" } and q is { "first", "/second" }.