Skip to content

Commit 090b412

Browse files
Fix typo in constinit example.
1 parent 1284ccd commit 090b412

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CPP20.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ const char* g() { return "dynamic initialization"; }
443443
constexpr const char* f(bool p) { return p ? "constant initializer" : g(); }
444444

445445
constinit const char* c = f(true); // OK
446-
constinit const char* d = f(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
446+
constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
447447
```
448448
449449
## C++20 Library Features

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ const char* g() { return "dynamic initialization"; }
546546
constexpr const char* f(bool p) { return p ? "constant initializer" : g(); }
547547

548548
constinit const char* c = f(true); // OK
549-
constinit const char* d = f(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
549+
constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
550550
```
551551
552552
## C++20 Library Features

0 commit comments

Comments
 (0)