Using variadic macros -- Andrzej Krzemieński

The latest from the desk of Andrzej:

Using variadic macros

by Andrzej Krzemieński

From the article:

But what struck me was something different. Why is it only some compilers that rejected my code. Why did most of the other compilers accept my apparently buggy code and produced the right result?

The answer is in the title of this post. Boost.StaticAssert is clever and wherever possible it uses variadic macros. ... it is now OK: all these arguments along with the separating commas are forwarded further (e.g., to static_assert) to the code that knows how to interpret these tokens. This is a very nice usage of variadic macros.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.