|
-
November 4th, 2005, 10:38 AM
#1
Regarding placement new
In my understanding, I think there is two ways to deallocate the memory when we use placement new. For example,
class Foo;
char* p = new char[16];
Foo* pFoo = new(p) Foo;
...
At the end, we might use either pFoo->~Foo() or delete[] p. Is my understanding correct? Thanks for your inputs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|