www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Problem with new (nothrow)

↑ ↓ ← "Alex Vinokur" <alexvn connect.to> writes:
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
Apr 15 2006
↑ ↓ → "Alex Vinokur" <alexvn connect.to> writes:
"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)'

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
Apr 15 2006