published on in .

m3ta: A Template Metaprogramming Library

Coding is not hype anymore—make place for code coding!

For the needs of a personal C++ project heavily relying on templates, I found myself coding more and more template metaprogramming utilities to the point where I wrote more lines of those than of the actual project itself. The time was for a refactoring—those utilities deserved their own dedicated library.

I thought that the process would take me only a couple of days—how naive of me. Extracting some utilities that work well within a specific project and turning them into something more bulletproof with the help of an extensive set of unit tests is... quit some work. Not even talking of the documentation entirely written manually in reStructuredText, without much help from Sphinx on the C++ front.

Nonetheless, it's now all good to go and I am pleased to introduce you m3ta!

Even though I sense that not many devs around here are versed into metaprogramming, I've made the source code available on GitHub, as usual. Note that this library relies on features from C++11.

What Sphinx helped me for though is to make the documentation compatible with the beautifully themed website.

If you're new to template metaprogramming but not to C++, I encourage you to check the examples from the documentation, the source code, or even better, to research the subject on the internet like I did.

Not only could it potentially expand your way of thinking and your overall programming skills (template metaprogramming in C++11 gives a small preview of what functional programming is), but it would also open the doors to a whole new set of tools for solving some problems more efficiently.

If you're more of the guru type, I'd be happy to hear from you if some points could be improved.

Say Something!