Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use the /constexpr
compiler options to control parameters for constexpr
evaluation at compile time.
Syntax
/constexpr:depth
N
/constexpr:backtrace
N
/constexpr:steps
N
Arguments
depth
N
Limit the depth of recursive constexpr
function invocation to N levels. The default is 512.
backtrace
N
Show up to N constexpr
evaluations in diagnostics. The default is 10.
steps
N
Terminate constexpr
evaluation after N steps. The default is 100,000. A step refers to an individual computation taken towards evaluating the constant expression. Increasing the maximum number of steps might cause compilation to take longer in cases where compilation would otherwise fail.
Remarks
The /constexpr
compiler options control compile-time evaluation of constexpr
expressions. Evaluation steps, recursion levels, and backtrace depth are controlled to prevent the compiler from spending too much time on constexpr
evaluation. For more information on the constexpr
language element, see constexpr
(C++).
The /constexpr
flag is available beginning in Visual Studio 2015.
To set this compiler option in the Visual Studio development environment
- Open your project's Property Pages dialog box.
- Select the Configuration Properties > C/C++ > Command Line property page.
- Enter /constexpr compiler options in the Additional Options box. Choose OK to save your changes.
To set this compiler option programmatically
- See AdditionalOptions.