Skip to main content
`Ctrl`+`K`

# PETSC_CONSTEXPR_14

C++14 constexpr No Fortran Support

## Notes

Equivalent to `constexpr` when using a C++ compiler that supports C++14. Expands to nothing if the C++ compiler does not support C++14 or when not compiling with a C++ compiler. Note that this cannot be used in cases where an empty expansion would result in invalid code. It is safe to use this in C source files.

## Example Usage

      PETSC_CONSTEXPR_14 int factorial(int n)
      {
        int r = 1;

        do {
          r *= n;
        } while (--n);
        return r;
      }

## See Also

`PETSC_NULLPTR`, `PETSC_NODISCARD`

## Level

beginner

## Location

include/petscmacros.h

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages