Subject: [boost] Template metaprogramming libraries
From: Ábel Sinkovics (abel_at_[hidden])
Date: 2011-09-07 16:29:15
Hi Boost developers,
I am a PhD student at Eotvos Lorand University, Budapest. My research
area covers C++ template metaprogramming. As part of my research I have
developed four template metaprogram libraries based on Boost.MPL. On my
conference appearances I was encouraged to submit my libraries to the
Here is a short summary of the libraries:
A tool for building embedded DSLs in C++. This is a compile-time parser
generator library. Using it one can build parsers that take compile-time
strings as input text and parse them as part of the C++ compilation
process. One can think of it as using Spirit at compile-time.
Typesafe printf implementation using metaparse. It provides printf
(sprintf, fprintf) functions taking the format string as a template
argument and type-checking it at compile-time. It is a practical
application of the metaparse library.
Monad implementation for C++ template metaprograms. The library provides
a framework for using monads in C++ at compile-time. The library
provides an embedded language for C++ template metaprogramming similar
to Haskell's do-notation. Using it, template metaprograms can be written
with a syntax that resembles procedural code. Unlike the approach
presented at this year's Boostcon, my library focuses on monads
evaluated completely at compile-time.
The library contains implementations for a number of monads available in
Haskell (Maybe, Either, Reader, Writer, State, etc.).
As an addition, the library contains a monad for error propagation in C
++ template metaprogramming. Based on the similarities of monadic error
propagation and exception handling in runtime C++, the library provides
an embedded language that resembles to exception handling. Using it, one
can throw and catch "exceptions" at compile-time.
Unit testing library for C++ template metaprograms. If a metaprogram
test case fails, it does not produce compilation error, but makes the
result information available at runtime. Using this one can generate
advanced reports and integrate the results into unit testing frameworks
for runtime C++ code. The library contains code that integrates it with
The source code, unit tests and examples for the library are available
I've tested the libraries with the following compilers:
- gcc 4.5
- clang 2.8
- Visual C++ 10
Full documentation of the libraries can be found at
Publications related to the libraries:
I would like to ask you for access to the Boost sandbox and I would
appreciate all feedback from the Boost community.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk