December 17, 2012
On Monday, 17 December 2012 at 14:29:49 UTC, Pavel wrote:
> Yup, it is only IMHO :) Useful for forgetful people as me: because without the utility template it is easy to forget to use 'mixin' and to put the statements in the block.

Corrected template to work with expressions too:

mixin template Compiles(string code)
{
  enum bool Result = __traits(compiles, mixin(code)) ||
                     __traits(compiles, mixin("{" ~ code ~ "}"));
}
1 2
Next ›   Last »