|
Boost : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-08-04 01:14:15
David Abrahams wrote:
> The documentation for create_directories makes no sense. It says
> only:
>
> void create_directories( const path & ph );
>
> Precondition: ph.empty() ||
> forall p: p == ph || is_parent(p, ph): is_directory(p) || !exists( p )
>
> Postcondition: exists(ph) && is_directory(ph)
>
> It looks as though this is the same as create_directory, but has a
> weird precondition.
Sure. It has the (almost) the same postcondition, but has waeker
precondition: the parent directories are not required to exist.
> I swear I was *completely* baffled by its
> purpose until I looked at the header file.
I'd say that pre/post conditions are just correct. Maybe more docs can be
added.
> The comment in the header file describes it pretty well, though.
Ehm... only postcondition there is not correct: is_empty(ph) is not
guaranteed.
- Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk