Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-19 19:34:21


----- Original Message -----
From: "Paul Mensonides" <pmenso57_at_[hidden]>
To: <boost_at_[hidden]>; "Vesa Karvonen" <vesa_karvonen_at_[hidden]>
Sent: Wednesday, June 19, 2002 7:41 PM
Subject: [boost] File-Iteration

> This is list of the names and descriptions of the interface macros used
to
> support file-iteration, please let me know if anyone doesn't like any of
them,
> or ask me a question. This is not intended to be documentation, just
macro
> names and short explanations of what they are use for (not how they are
used).
>
> If anyone has any problems with these names or wishes me to clarify. Let
me
> know.
>
> Paul Mensonides
>
> -----

All IMO, of course. When suggesting new names I guessed about which are
likely to be needed commonly by users.

> BOOST_PP_IS_ITERATING
>
> Is defined if the library is currently iterating over a file.
>
> BOOST_PP_ITERATION_DEPTH_LIMIT
>
> Expands to the maximum file-iteration depth supported by the library.
> This value is currently 5.
>
> BOOST_PP_ITERATION_LIMIT
>
> Expands to the maximum number of file-iterations supported by the
library
> per depth of iteration. This value is currently 256.
>
> BOOST_PP_DEFAULT_LBOUND
>
> Expands to the default lower bound (if unspecified) that the library
uses.
> This is currently defined as 0 to match the horizontal primitives like
> BOOST_PP_REPEAT.

I know what "horizontal" means, I think... real docs would spell it out.

> BOOST_PP_DEPTH()
>
> Expands to the current depth of iteration. Initially, this is zero,
but is
> incremented whenever an iteration is entered.

should be BOOST_PP_ITERATION_DEPTH

> BOOST_PP_FILE_ARG()
>
> Expands to the number associated with the current iteration.

should be BOOST_PP_ITERATION

> BOOST_PP_RELATIVE_ARG(i)
>
> Expands to the number associated with the current iteration or outer
> iterations. BOOST_PP_RELATIVE_ARG(0) is equivalent to
BOOST_PP_FILE_ARG().
> BOOST_PP_RELATIVE_ARG(1) is equivalent to the number associated with the
outer
> iteration immediately preceding the current one.
BOOST_PP_RELATIVE_ARG(2)
> expands to the one before that, etc..

should be BOOST_PP_FRAME(i) or BOOST_PP_ITERATION_FRAME(i)

> BOOST_PP_LBOUND()
>
> Retrieves the lower bound of the current iteration.

BOOST_PP_ITERATION_START

> BOOST_PP_UBOUND()
>
> Retrieves the upper bound of the current iteration.

BOOST_PP_ITERATION_FINISH

> BOOST_PP_BOUND
>
> User-defined macro for setting the boundaries of a iteration.

BOOST_PP_ITERATION_RANGE

> BOOST_PP_SET_LBOUND()
>
> Macro used to set the lower bound of the next iteration. In
conjunction
> with BOOST_PP_BOUND, this abstracts the depth of iteration.

Now I'm confused. More explanation needed.

> BOOST_PP_SET_UBOUND()
>
> Macro used to set the upper bound of the next iteration. In
conjunction
> with BOOST_PP_BOUND, this abstracts the depth of iteration.
>
> BOOST_PP_RELATIVE_LBOUND(i)
> BOOST_PP_RELATIVE_UBOUND(i)
>
> Similar to BOOST_PP_RELATIVE_ARG, but returns the lower and upper
bounds,
> respectively, of outer iterations.

BOOST_PP_FRAME_START(i)
BOOST_PP_FRAME_FINISH(i)

(could use BEGIN/END if it's half-open, or FIRST/LAST if not)

> BOOST_PP_LINE(line, file)
>
> Debugging macro that appends all the current iteration values to the
> filename in a line directive.
>
> BOOST_PP_FILENAME_1
> BOOST_PP_FILENAME_2
> BOOST_PP_FILENAME_3
> BOOST_PP_FILENAME_4
> BOOST_PP_FILENAME_5
>
> Macros used as filenames for the mechanism to iterate over. These
cannot be
> abstracted, but the BOOST_PP_DEPTH() macro can be used to set the right
one if
> necessary.
>
> BOOST_PP_ITERATE()
>
> Macro used to begin an iteration.

I'm a little confused about how you use these. I think I need examples.

Nice start,

-Dave


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