On 23 Jul 2015, at 23:40, Jeffrey Walton <noloader@xxxxxxxxx> wrote: >> Why don't you simply use a C++ static_assert? >> >> static_assert(foo==bar, "foo should have been bar"); > > C++ 03. > > Jeff You could try the typedef variant of the C++98 static assert and attach an attribute unused to the typedef. See also: http://stackoverflow.com/questions/6954284/why-prefer-template-based-static-assert-over-typedef-based-static-assert http://stackoverflow.com/questions/386220/how-can-i-hide-defined-but-not-used-warnings-in-gcc Cheers, Oleg