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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top