Boost logo

Boost Users :

Subject: [Boost-users] 99 Bottles of Beer using Boost MPL, feedback invited
From: Alastair Rankine (arsptr_at_[hidden])
Date: 2011-08-07 07:53:34


So inspired by
http://programmingpraxis.com/2011/08/05/ninety-nine-bottles-of-beer/ ,
I decided to attempt to generate the lyrics to the 99 bottles of beer
song. To make it interesting I decided to use Boost MPL to generate the
lyrics using template metaprogramming.

Here is my attempt.

https://gist.github.com/1130306

It compiles with gcc 4.2 against boost 1.47.

Given that I am pretty inexperienced with MPL I would very much
appreciate some constructive criticism. I'd specifically like to know
if the code can be cleaned up to be simpler or to perform better. Also
I'm not entirely happy with the duplication in the PrintX functors,
would definitely like to get a better approach here.

Thanks,


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