The incredible power of using static assert in C++

Josh Weinstein
Better Programming
Published in
5 min readOct 24, 2023

--

Photo by John Schnobrich on Unsplash

In most programming languages, an assert is often utilized to catch a program's unexpected or unintended states and situations. However, an assert is also a runtime conditional check. This means that a programmer will need to run and execute that particular piece of code for the assert to take effect. Some languages, such as C++, have the capability to turn off asserts depending on the type of program…

--

--

I’m an engineer on a mission to write the fastest software in the world.