xamarin.ios - Simplest an fastest C# Expression that always evaluates to false and does not generate a compiler warning -
i have rather esotheric case need have piece of code never execute still needs part of compilation output. although come own, i'm asking community: simplest , fastest c# expression evaluates false , not generate compiler warning , preserves enclosed block of code in final build output?
update: since explaining rationale behind question requested: monotouch linker performs static code analysis in order strip unreferenced symbols out of final build decrease size of generated binaries. poses problem properties accessed through reflection.
i'd go simple...
public static bool false() { return false; } public static void foo() { if (false()) { ... } }
if need convince jit (inlining), add [methodimpl(methodimploptions.noinlining)]
false()
Comments
Post a Comment