K
kvnil
Any idea why would the following executable would crash (on Windows, VS2005
compiler)?
#include <memory>
struct C{};
int main(int argc, char** argv[])
{
std::auto_ptr<C> pC /*(new C())*/;
pC = new C();
return 0;
}
If the "new" part is move into the auto_ptr ctor (the commented part), the
exe terminates fine. Otherwise, it goes postal.
-- kvnil
compiler)?
#include <memory>
struct C{};
int main(int argc, char** argv[])
{
std::auto_ptr<C> pC /*(new C())*/;
pC = new C();
return 0;
}
If the "new" part is move into the auto_ptr ctor (the commented part), the
exe terminates fine. Otherwise, it goes postal.
-- kvnil