4 ms·
Ah, you’re right, it’s not POD, but it should still be safe to reuse the storage in this way. You’re also right about the reinterpret_cast, but it’s not necessa
by evincarofautumn 12y ago
Ah, you’re right, it’s not POD, but it should still be safe to reuse the storage in this way. You’re also right about the reinterpret_cast, but it’s not necessary for this example because placement new takes a “void” pointer—I just did it to get the convenience of “+ 1” instead of “+ sizeof(node)”.