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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -