Commit acf0fd8e3fed6c2b1d446267077ae9118aadde30

Authored by Grzegorz Jabłoński
1 parent 7e10c6d3

Fixed comment in placement new

examples11/02-new/placementnew2.cpp
@@ -8,7 +8,6 @@ main () @@ -8,7 +8,6 @@ main ()
8 { 8 {
9 std::aligned_storage_t<sizeof(string), alignof(string)> buf; 9 std::aligned_storage_t<sizeof(string), alignof(string)> buf;
10 string *s = new (&buf) string; // construct an string at .buf;. invokes: operator new(sizeof(string),buf); 10 string *s = new (&buf) string; // construct an string at .buf;. invokes: operator new(sizeof(string),buf);
11 - // actually undefined behaviour - alignment restrictions might not be fulfilled  
12 *s = "hello"; 11 *s = "hello";
13 cout << *s << endl; 12 cout << *s << endl;
14 s->~string(); 13 s->~string();