Normally, asserts are only compiled into debug versions
of the code, and removed for release versions.
I know a lot of languages default to this, and it always seemed like a bad decision to me. The performance benefits of most checks are trivial compared to the major downside of not testing the exact code you release.Several times I've had to track down bugs that have been very difficult to find, as they were 'fixed' by side effects of assert statements and hence didn't show up in debug builds.
If a check really can't be performed in the release version for performance reasons, just separate it out into a unit test.