I am looking for a way to have compile time assertions in the C# programming language, such as those provided by the BOOST library for C++, or the new C++0x standard.

My question is twofold; can this be achieved in standard, portable C#; Alternatively, can the behaviour be achieved via non-portable assumptions of the quirks of a given C# compiler?

A quick search on google revealed the following link to one technique, whose standards compliance and compatibility I am unsure of.

c#
Edit
Report