Commit 84f16473d997ceee12047c0b2a8bd4fb57c80abc
1 parent
5cfd8c22
Updated for aligned_storage deprecation
Showing
3 changed files
with
1 additions
and
1 deletions
examples11/03-new/placementnew2.cpp
@@ -5,7 +5,7 @@ using namespace std; | @@ -5,7 +5,7 @@ using namespace std; | ||
5 | 5 | ||
6 | int main() | 6 | int main() |
7 | { | 7 | { |
8 | - std::aligned_storage_t<sizeof(string), alignof(string)> buf; | 8 | + alignas(string) char buf[sizeof(string)]; |
9 | string* s = new (&buf) string; // construct an string at .buf;. invokes: | 9 | string* s = new (&buf) string; // construct an string at .buf;. invokes: |
10 | // operator new(sizeof(string),buf); | 10 | // operator new(sizeof(string),buf); |
11 | *s = "hello"; | 11 | *s = "hello"; |
slides-english/oopc-11.pdf
No preview for this file type
slides-polish/po-11.pdf
No preview for this file type