Finally, a new “Expressive C++” article. I’m pretty excited because I’ve covered enough of Proto’s basics to get to talk about the good stuff: how to manipulate expressions using grammars and transforms. This is potent stuff. In this article, I show how to use Proto to completely eliminate the abstraction overhead in a simple linear algebra library. Without giving up the accepted domain syntax. And without a pile of nasty template spaghetti code. Enjoy.
My latest article about EDSLs and Boost.Proto is up at Cpp-Next. This one completes a little lambda library in about 30 lines of C++. I also ruminate on the many layers of understandings about expressions in C++. Swing on over, have a look, leave a comment!
The latest in my series of posts on embedded Domain-Specific Languages in C++ continues. This one sketches the outline of a simple lambda library using Boost.Proto.
For Boost.Xpressive, multi-capture (the ability of a capturing group to remember all the times matches, instead of only the last) is an oft-requested feature. Since it could be faked with Xpressive’s implementation of named regexes, so adding multi-capture has never been high on my priority list. Well, it looks like someone went ahead and implemented it for me: