c++ - Problem with new (nothrow)
- Alex Vinokur (24/24) Apr 15 2006 Digital Mars C++ doesn't compile a program below.
- Alex Vinokur (11/17) Apr 15 2006 ...........................................................................
- %u (1/1) Oct 12 2008 mingw 3.4.2 compiler does
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> 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
Apr 15 2006