Skip to content

Glossary: Coding Interviews in C++

assert

Also written: <cassert>, assert macro

A macro from `<cassert>` that does nothing when its condition is true. When the condition is false it prints the file and line and aborts the program, which makes it a quick way to write tests.

Where the book teaches it

Related terms

-DNDEBUGTest functionMacro