Boost logo

Boost :

From: Matt Austern (austern_at_[hidden])
Date: 2002-01-31 12:21:01

Jason Stewart wrote:

> This is making my head hurt.
> I think you're right, the right way is the way the OS does it. I'm not sure
> of the best way to handle that. However, it seems important to have at
> least basic comparison functionality. I often find myself wanting to put
> Filenames in a std::map so would be nice to have at least have a
> specialized less, similar to shared_ptr.

But what does comparison mean? The strings "b/c" and "b/./c" and
"b/../b/c" and "../a/b/c" are all different, but on Unix the
first three are the same path and the last might be as well. (And
I'm not even getting to links.)

I suppose my feeling is: if all you mean by comparison is string
comparison, then there's no need to provide a special feature. Just
write the paths out in human readable form and compare them.
Sometimes it'll work, sometimes it won't. If you mean something
other than string comparison then it's a hard problem, and you need
to define exactly what you want.


Boost list run by bdawes at, gregod at, cpdaniel at, john at