Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Header for 'new'

Reply
Thread Tools

Header for 'new'

 
 
qazmlp
Guest
Posts: n/a
 
      08-20-2003
<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 ;
 
Reply With Quote
 
 
 
 
Pete Becker
Guest
Posts: n/a
 
      08-20-2003
Ron Natalie wrote:
>
> "qazmlp" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) 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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
UNIX header files to Windows header files anand.ba@gmail.com C Programming 3 05-01-2006 03:57 PM
Header files included in header files John Smith C Programming 18 07-24-2004 04:55 AM
What is better /standard for creating files. a cpp file with header or cpp and seperate file for header DrUg13 C++ 1 02-10-2004 09:20 AM
how to avoid using another header file inside a header file? Newsgroup - Ann C++ 4 11-02-2003 01:20 PM



Advertisments