Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-02-23 14:33:44


Jeff,

In the document (which I really should have called Requirements and General
Specs, to distinguish from detailed design) I didn't want to get into
details to the point where I specified which (or all) of these would be
valid:

   // get() and remove() on names
   for (dir_it i ("/usr/junk"); i != dir_it (); ++i)
   {
     if (!get <is_directory> (compose ("/usr/junk", *i)))
     {
       remove (compose ("/usr/junk", *i));
     }
   }

   // get() and remove() on iterators
   for (dir_it i ("/usr/junk"); i != dir_it (); ++i)
   {
     if (!get <is_directory> (i))
     {
       remove (i);
     }
   }

The first is minimalist, the second easier to use.

We have to have the first (path) forms, because iterators aren't always
available (without doing an unnecessary search).

Also supplying the iterator forms provides ease-of-use. If (as I think
will happen) we really only have a few functions, also providing the
iterator forms would not hugely increase the size (and thus cost).

--Beman


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