Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Preprocessing/CompileTimeAssertions

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

The traditional way to assert the truth of something at compile-time was to use the preprocessor's #error (within some #if block). But some compile-time activity happens after the preprocessor has finished, so modern code uses a static_assert() compile-time assertion. Additional information about compile-time assertions (includes interactive examples)