Boost logo

Boost :

From: Jason Stewart (res0054p_at_[hidden])
Date: 2002-01-31 14:45:07


At 09:21 AM 1/31/2002 -0800, you wrote:
>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.
>
> --Matt

I'm saying, the basic less<pathname> does simple, non-case sensitive,
string comparison simply so that they work out of the box with std::map. It
looks like this was the decision used for shared_ptr. What does less on a
pointer mean except to arrange in order of memory? Is this useful? In my
mind, only in that it allows use with std::map. (Or, maybe I misunderstood
less<shared_ptr>, does it use less<contained_type>?)

Jason


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk