Boost logo

Boost Users :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2006-05-12 13:20:50


"Sohail Somani" <s.somani_at_[hidden]> wrote

> > I am quite interested in MPL/Fusion. I have made my own toy projects
> > using template metaprogramming to make decisions at compile time. I am
> > interested in learning what types of software boost users create with
> > it.
> >
> > Would anyone care to share?
>
> I think I should clarify: I meant non-library uses (like the maze app,
> I'll take a look thanks!). Like a programmer who also uses shared_ptr.
> Although I can think of a few instances where I would use it for work, I
> just want to tell myself that I am making things complicated and want
> your help to make sure I'm making better code.

There could be different opinions on this subject, but I think the basic
rule of thumb should be: no template metaprogramming in the non-library
code. Of course, most C++ programmers are wearing two hats: a library
(reusable code) writer and the user of this reusable code. The key is to
distinguish which hat you are wearing at any particular moment :-)

So my guess is you will not find a lot of MPL usage examples in the
application development. Most of these examples are in the area of library
development where template metaprogramming (and MPL) proved to be
tremendously useful.

Just make sure that you also add Boost.Preprocessor to the equasion.
Preprocessor metaprogramming adds capabilities missing in template
metaprogramming, thus multiplying its power.

HTH,
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