Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-07-03 19:52:05

Bjørn Roald wrote:
> Beman Dawes wrote:
>> David Abrahams wrote:
>>> So one other option that avoids the above issues (not that I'm pushing
>>> this route) is to pick another name for what you currently call leaf().
>> Let's say branch_path() is changed to parent_path(). That suggests a
>> full set of names based on the parent/child decomposition of a path:
>> * Change branch() to parent_path()
>> * Change leaf() to child()
>> * Change basename() to child_prefix()
>> * Change extension() to child_extension()
>> At first glance, those names seem reasonable clear and self-consistent.
>> What's your take on that set?
> I am not sure this is any good. Considder the path "../../a/b" and the
> meaning of parent and child.
> The only sensible parent is in the middle and we don't even know it's
> name. Children are at both ends the implicit "." or "b".

The parent of '../../a/b' is '../../a'
The parent of '../../a' is '../..'
The parent of '../..' is probably '../../..'

If Beman intended '..' to be the result of the final transformation
above, then we should be using something like pop() to describe it.

Dave Abrahams
BoostPro Computing

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