compile time assert

  • Thread starter Thread starter marco_segurini
  • Start date Start date
M

marco_segurini

Hi,

Is there any way in C# to perform a compile-time-assert (like
BOOST_STATIC_ASSERT in C++)?

Thanks a lot.
Marco.
 
Marco,

No, I don't believe there is. With MSBUILD though (the new build system
with .NET 2.0), you can create your own tasks to check the conditions that
you want to check, and fail the process if the conditions are not met. This
will also work in VS.NET, as it uses the MSBUILD system for it's build
process as well.

Hope this helps.
 
Back
Top