Fix typo in constinit example.

This commit is contained in:
Anthony Calandra
2024-08-06 22:56:13 -04:00
parent 1284ccd3cf
commit 090b412f3f
2 changed files with 2 additions and 2 deletions

View File

@@ -443,7 +443,7 @@ const char* g() { return "dynamic initialization"; }
constexpr const char* f(bool p) { return p ? "constant initializer" : g(); }
constinit const char* c = f(true); // OK
constinit const char* d = f(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
```
## C++20 Library Features