constexpr

suggest change

Versions

Introduction

constexpr is a keyword that can be used to mark a variable’s value as a constant expression, a function as potentially usable in constant expressions, or (since C++17) an if statement as having only one of its branches selected to be compiled.

Remarks

The constexpr keyword was introduced in C++11. Later standards progressively relaxed the restrictions on constant evaluation and expanded where constexpr can be used.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents