By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,898 Members | 2,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,898 IT Pros & Developers. It's quick & easy.

Header for 'new'

P: n/a
<new> header should be included whenever 'placement new' is used.
What header should be included when I use the normal 'new' operator like this?
int* intPtr = new int ;
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ron Natalie wrote:

"qazmlp" <qa********@rediffmail.com> wrote in message news:db**************************@posting.google.c om...
<new> header should be included whenever 'placement new' is used.
What header should be included when I use the normal 'new' operator like this?
int* intPtr = new int ;


No header is required. No header is required for placement new either.


The header <new> is required for placement new. The four implicitly
declared allocation and deallocation functions (3.7.3/2) are:

void *operator new(size_t) throw(std::bad_alloc);
void *operator new[](size_t) throw(std::bad_alloc);
void operator delete(void*)
void oeprator delete[](void*);

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.