This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: extra parameters to operator delete ?


David C Binderman <dcb@pncl.co.uk> writes:

> void operator delete( void * , double) { };

> I believe it is an error to have double in the parameter list.

I don't think so, check [basic.stc.dynamic.deallocation]/2.
Furthermore, given:

struct foo { foo() { throw false; } };
void* operator new(size_t, double);

It is operator delete(void*, double) that will be called to release
the memory allocated with `new(1.0) foo' before the `false' exception
propagates out of the new-expression [except.ctor]/2.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]