constexpr variables are a powerful feature of C++. They have the potential to improve runtime performance and also convert some runtime errors to compile time errors. However, they are sparely used in code bases due to the constraints they impose on the developer. This post will argue that their use, especially in the context of templating should be considered more often.
Categories