C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The C++ Standard Doesn't Permit Overloading new and delete?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Lighter
Guest





PostPosted: Wed Aug 09, 2006 9:10 am    Post subject: The C++ Standard Doesn't Permit Overloading new and delete? Reply with quote



The C++ Standard Doesn't Permit Overloading new and delete?

In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find
the specification on overloading the operators new and delete; however,
many C++ books including "C++ Primer" say that the operators new and
delete can be overloaded. I wonder if this has definitive
specification? Who can tell me?

Many thanks to those who answer.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Jean-Louis Leroy
Guest





PostPosted: Wed Aug 09, 2006 5:35 pm    Post subject: Re: The C++ Standard Doesn't Permit Overloading new and dele Reply with quote



Quote:
In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find

the specification on overloading the operators new and delete



See 3.7.3.

--

Jean-Louis Leroy

Sound Object Logic

http://www.soundobjectlogic.com



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Guest






PostPosted: Wed Aug 09, 2006 5:35 pm    Post subject: Re: The C++ Standard Doesn't Permit Overloading new and dele Reply with quote



Lighter wrote:
Quote:
The C++ Standard Doesn't Permit Overloading new and delete?

In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find
the specification on overloading the operators new and delete; however,
many C++ books including "C++ Primer" say that the operators new and
delete can be overloaded. I wonder if this has definitive
specification? Who can tell me?

Many thanks to those who answer.


Even I thought that new and delete cannot be overloaded, so if
you got somthing please do tell me........


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Martin Bonner
Guest





PostPosted: Wed Aug 09, 2006 5:36 pm    Post subject: Re: The C++ Standard Doesn't Permit Overloading new and dele Reply with quote

Lighter wrote:
Quote:
The C++ Standard Doesn't Permit Overloading new and delete?

In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find
the specification on overloading the operators new and delete; however,
many C++ books including "C++ Primer" say that the operators new and
delete can be overloaded.

See 3.7.3.1, and in particular 5.3.4 p8 (and subsequent paragraphs).
12.5 is also useful.

You need to search for "operator new".

Quote:
I wonder if this has definitive specification?
Well clearly the standard document is definitive for standard C++.

However it requires a signficant level of expertise to interpret.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Ron Natalie
Guest





PostPosted: Thu Aug 10, 2006 5:34 pm    Post subject: Re: The C++ Standard Doesn't Permit Overloading new and dele Reply with quote

Lighter wrote:
Quote:
The C++ Standard Doesn't Permit Overloading new and delete?

In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find
the specification on overloading the operators new and delete; however,
many C++ books including "C++ Primer" say that the operators new and
delete can be overloaded. I wonder if this has definitive
specification? Who can tell me?

The new and delete operators CAN NOT be overloaded.


There are functions called "operator new" and "operator delete"
but they are unfortunate names. Rather than being the implementation
of those operators, they are the memory allocation functions
that new/delete calls.

There's too much happening behind the scenes of object creation
that you can't implement even if you wanted to do so. Your
stuck with playing with the allocation functions and the constructors
themselves.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.