Two boost::mpl examples

metaprogramming

Six months ago I indulged in some C++ metaprogramming hackery. I’d read through Abraham’s and Gurtovoy’s excellent book and wanted to try out some of their concepts. I recently found some of the code I’d written during this phase on paste bin. Here I present the two example with a brief description.

The first example implements some contrived functionality that demonstrating the metaprogramming equivalents of vectors, maps, and iterators. The source is available at http://pastebin.com/UMPh6TuX.

The second example brute forces problem 1 from Project Euler (the problem statement is repeated in the heading comment). The source is available at http://pastebin.com/NK9BMyz6.

(Image source http://martinfowler.com/articles/rubyAtThoughtWorks.html)

Bookmark and Share

Leave a Reply