Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-05-05 09:23:10

At 04:14 AM 5/5/2003, Vladimir Prus wrote:

>Beman Dawes wrote:
>> * I think the preconditions should be removed. In each case, the
>> as specified is quite sensible even if ph.leaf().empty(), and may be
>> in some applications. (Assuming you agree, the assert()'s should be
>> removed, and test cases should be added.)
>Let me ponder a little. For 'extension', the idea that empty path has
>extension seems ok. For 'basename' this looks even more resonable.
>for "change_extension", this is not so. If you call
> change_extension("", ".txt")
>you'll get ".txt" as result, which has no sense at all. But I'm not sure
>the assertion, here, is so big help. So I'll removed precondition here
>as well, but add a bit of rationale.

Good. I agree with your reasoning.

>However, I've a question: if is always true that ph.leaf().empty() ==

Yes, that's both intuitively correct and follows from the specification
path()'s return.

> IOW, is it ever possible to have empty element in the sequence of
>strings that compose the path?

No, not in a path which follows the portable grammar. It is a little less
clear for a native path on a system other than POSIX or Windows, but I
don't think we should agonize over that corner case.



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