Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Default functions implemented by compiler
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Frederick Gotham, post: 2566545"] Sekhar posted: (I'm going to use "malloc" in this example just to try to make it easier to understand.) Here is a normal use of "new": Type *p = new Type; This does two things: (1) It allocates memory. (2) It constructs an object at that location in memory. Here is a special use of "new" called "placement new": Type *p = malloc( sizeof(Type) ); /* This only allocates memory */ ::new(p) Type; /* This constructs an object at the address specified by "p" */ For info on "placement new", try this: [URL]http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.10[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Default functions implemented by compiler
Top