I followed the teachings of the following articles:
- An exception or a bug? (Miro
Samek, C/C++ Users Journal, 2003)
- Simple Support for Design by Contract
in C++ (Pedro Guerreiro, TOOLS, 2001)
What I ultimately applied was pretty much Samek's approach. Just creating macros for REQUIRE, ENSURE, CHECK and INVARIANT (based on the existing assert macro) was very useful. Of course it's not as good as native language support but anyway, it allows you to get most of the practical value from the technique.
As for libraries, I don't think that it pays to use one, because one important value of the assertion mechanism is its simplicity.
For the difference between debug and production code, see When should assertions stay in production code?.