Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-11-27 13:25:24


At 09:56 AM 11/27/2002, Beman Dawes wrote:

>...
>
>There has also been so consideration of providing has_xxx query
functions,
>which would express the above as:
>
> foo.has_root_directory()
>
>Pros: Expresses concept a bit more directly, may be implemented more
>efficiently than decomposition followed by empty().
>Con: Fattens the interface.

So far, on firm ground. And the has_xxx functions will be provided.

>If has_xxx query functions are provided, then there isn't really a need
for
>a separate absolute query, since foo.has_root() (or
>foo.has_root_directory(), for those who prefer your definition.)

But that isn't correct; has_root() is (a) actually named has_root_path(),
and (2) not the correct semantics, as it is true if either (rather than
both) system_specific_root() or root_directory() is not empty.

>Not having a function named absolute() might be safest, too, because it
>would force users to choose exactly the has_xxx function they wanted,
>rather than jumping to a conclusion about the semantics of absolute().

The name will be is_complete() and the semantics will be:

    has_root_directory() // single rooted systems like POSIX
    has_system_specific_root()
      && has_root_directory() // all others, like Windows

--Beman


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