Boost logo

Boost Users :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2007-05-25 12:08:05


"Arkadiy Vertleyb" <vertleyb_at_[hidden]> wrote

> If your goal is to generate some repeatative code, you could probably get
> away with your own generator. I suspect most applications of Boost PP are
> just like this.
>
> OTOH, if you want to define a macro which expands according to parameters
> provided by your macro users, your generator will not help you, but Boost
> PP will, and it will help you tremendously.
>
> As an example, the implementation of typeof emulation in Boost.Typeof
> would not be possible without Boost PP (or a similar library).

Second thing, it's just plain more convenient. Instead of writing your own
code generator as a separate app, then including it in the build process,
you just deal with all the code generation right in your source file. If
you are writing a library, especialy header-only library, you would not want
to tell your users they need to install an additional application, and
include it in their build process, just to use your lib.

I guess this is why Boost PP is used so extensively by other Boost
libraries.

Regards,
Arkadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net