Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #37091

Re: Why are there throw() following the delete[]?

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Why are there throw() following the delete[]?
Date 2015-07-16 11:18 +1200
Message-ID <d0o824FqegtU5@mid.individual.net> (permalink)
References <20afc0b3-d071-4681-8bea-de40158a7ff0@googlegroups.com>

Show all headers | View raw


fl wrote:
> Hi,
>
> When I search delete description for C++, I find the following:
>
> ordinary (1)	
> void operator delete[] (void* ptr) throw();
> nothrow (2)	
> void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw();
> placement (3)	
> void operator delete[] (void* ptr, void* voidptr2) throw();
>
<snip>
>
> I am puzzled about:
>
> 1. In the normal use of delete[], I never see the throw() following it;
> 2. The description does not mention about throw() although the upper part
>     has throw()

These describe the operators as defined in <new>.  The throw() (noexcept 
in modern C++) is telling you that the operators will not throw.

You don't include the throw() when you use operator delete, it is only 
appropriate in the declaration.


-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Why are there throw() following the delete[]? fl <rxjwg98@gmail.com> - 2015-07-15 16:05 -0700
  Re: Why are there throw() following the delete[]? Ian Collins <ian-news@hotmail.com> - 2015-07-16 11:18 +1200
    Re: Why are there throw() following the delete[]? fl <rxjwg98@gmail.com> - 2015-07-15 16:36 -0700
      Re: Why are there throw() following the delete[]? Ian Collins <ian-news@hotmail.com> - 2015-07-16 11:44 +1200
      Re: Why are there throw() following the delete[]? Bo Persson <bop@gmb.dk> - 2015-07-16 11:03 +0200

csiph-web