Thread overview
Problem with new (nothrow)
Apr 15, 2006
Alex Vinokur
Apr 15, 2006
Alex Vinokur
Oct 12, 2008
%u
April 15, 2006
Digital Mars C++ doesn't compile a program below.

------ foo.cpp ------
#include <new>
using namespace std;

main()
{
char* p = new (nothrow) char [100];
  delete[] p;
  return 0;
}
------------------

dmc 8.42.n (Dowloaded as Version 8.47)

-------------------------------------------------
$ dmc -I. -IC:/dm/stlport/stlport foo.cpp
char* p = new (nothrow) char [100];
                                  ^
foo2.cpp(6) : Error: no match for function '?_P(unsigned ,const std::nothrow_t)'

--- errorlevel 1
-------------------------------------------------


-- 
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn



April 15, 2006
"Alex Vinokur" <alexvn@connect.to> wrote in message news:e1qnjm$1vec$1@digitaldaemon.com... [snip]
> -------------------------------------------------
> $ dmc -I. -IC:/dm/stlport/stlport foo.cpp
> char* p = new (nothrow) char [100];
>
...............................................................................................                                ^
> foo2.cpp(6) : Error: no match for function '?_P(unsigned ,const std::nothrow_t)'
Of course:
foo.cpp(6) : Error: no match for function '?_P(unsigned ,const std::nothrow_t)'
...............................................................................................
>
> --- errorlevel 1
> -------------------------------------------------

-- 
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn





October 12, 2008
mingw 3.4.2 compiler does