Header for 'new'

Discussion in 'C++' started by qazmlp, Aug 20, 2003.

  1. qazmlp

    qazmlp Guest

    <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 ;
     
    qazmlp, Aug 20, 2003
    #1
    1. Advertising

  2. qazmlp

    Pete Becker Guest

    Ron Natalie wrote:
    >
    > "qazmlp" <> wrote in message news:...
    > > <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)
     
    Pete Becker, Aug 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newsgroup - Ann
    Replies:
    4
    Views:
    709
    lilburne
    Nov 2, 2003
  2. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Replies:
    18
    Views:
    608
    Jack Klein
    Jul 24, 2004
  3. Replies:
    3
    Views:
    1,305
    Walter Roberson
    May 1, 2006
  4. mlt
    Replies:
    2
    Views:
    845
    Jean-Marc Bourguet
    Jan 31, 2009
  5. Replies:
    2
    Views:
    465
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page