Skip to content

Comment on Solving FizzBuzz with C++ compiler error messages

Comments

I don't see the value in producing an error instead of using the meta-program to produce an unrolled loop with mpl::for_each that actually prints the sequence at run-time. ;)

Seriously, the MPL is a powerful and surprising beast but in most cases some preprocessor library like Boost.Preprocessor or Chaos is unavoidable to really make it useful. In fact, you can write this complete program with the preprocessor and I would actually prefer it (or const expression meta-programming).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.