2 ms·
There is a whole library around this and similar techniques in Boost. I've used it before on several occasions. It's quite nice, although it somewhat lays a t
by PatrickAMoran 11y ago
There is a whole library around this and similar techniques in Boost. I've used it before on several occasions. It's quite nice, although it somewhat lays a trap, in the sense that CPP really should be your metaprogramming technique of last (or second-to-last) resort, so it remaining difficult keeps your incentives in line. :)
I've never used Chaos PP (the predecessor of Boost.Preprocessor), but IIRC, it enables even more cool stuff at the cost of reduced portability (Boost.Preprocessor contains all the hacks to work on broken preprocessors, while I think Chaos takes more of a "fix your preprocessor" approach).
http://www.boost.org/doc/libs/1_59_0/libs/preprocessor/doc/index.html http://www.boost.org/doc/libs/1_59_0/libs/preprocessor/doc/i...