July 05, 2010 is(typeof(mixin(X))) and __traits(compiles, mixin(X)) | ||||
---|---|---|---|---|
| ||||
Is there a way to use string mixins with is(typeof(X)) and/or __traits(compiles, X)? As far as I can tell, if I do either of the following is(typeof(mixin(X))) __traits(compiles, mixin(X)) it does not mixin the string and test that for compilation but rather tests whether the mixin expression itself compiles. Is there way to actually test a mixed in string for compilation rather than the mixin expression itself? - Jonathan M Davis |
July 05, 2010 Re: is(typeof(mixin(X))) and __traits(compiles, mixin(X)) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On 2010-07-05 10.03, Jonathan M Davis wrote: > Is there a way to use string mixins with is(typeof(X)) and/or __traits(compiles, > X)? As far as I can tell, if I do either of the following > > is(typeof(mixin(X))) > > __traits(compiles, mixin(X)) > > it does not mixin the string and test that for compilation but rather tests > whether the mixin expression itself compiles. Is there way to actually test a > mixed in string for compilation rather than the mixin expression itself? > > - Jonathan M Davis Try to wrap the whole expression in the string mixin. -- Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation