:orphan:
# 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
```none
  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
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscmacros.h.html#PETSC_CONSTEXPR_14">include/petscmacros.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscmacros.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
