Skip to content

Commit 5c139f2

Browse files
authored
Merge pull request #4425 from fsb4000/patch-2
virtual functions can be constexpr
2 parents f1cce1d + 3221455 commit 5c139f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/cpp/constexpr-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The following rules apply to constexpr functions:
6161
6262
- A **`constexpr`** function can be recursive.
6363
64-
- It can't be [virtual](../cpp/virtual-cpp.md). A constructor can't be defined as **`constexpr`** when the enclosing class has any virtual base classes.
64+
- Before C++20, a **`constexpr`** function can't be [virtual](../cpp/virtual-cpp.md), and a constructor can't be defined as **`constexpr`** when the enclosing class has any virtual base classes. In C++20 and later, a **`constexpr`** function can be virtual. Visual Studio 2019 version 16.10 and later versions support **`constexpr`** virtual functions when you specify the [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later compiler option.
6565
6666
- The body can be defined as `= default` or `= delete`.
6767

0 commit comments

Comments
 (0)