Visual c++ std::bad_alloc::bad_alloc”:无法访问在类“std::bad_alloc”中声明的私有成员 我想把VisualStudio 2008中的一个项目迁移到VS 2012 C++。我很好奇为什么当我试图用字符串映射抛出异常时出现这个错误。 STD::BADYOLL没有一个公共构造函数取一个参数。唯一的公共构造函数是不带参数的默认构造函数

Visual c++ std::bad_alloc::bad_alloc”:无法访问在类“std::bad_alloc”中声明的私有成员 我想把VisualStudio 2008中的一个项目迁移到VS 2012 C++。我很好奇为什么当我试图用字符串映射抛出异常时出现这个错误。 STD::BADYOLL没有一个公共构造函数取一个参数。唯一的公共构造函数是不带参数的默认构造函数,visual-c++,Visual C++,显然,您使用的实现有一个私有构造函数,其中包含一个参数,但您当然不能实际使用它,它是私有的,而且是所有参数。为什么要删除帖子的内容? C1EVMLogging::PublishError( NULL, C1EVMLogging::C1EVM, C1EVMLogging::Service, C1EVMLogging::Failure, NULL, NULL,

显然,您使用的实现有一个私有构造函数,其中包含一个参数,但您当然不能实际使用它,它是私有的,而且是所有参数。

为什么要删除帖子的内容?
C1EVMLogging::PublishError( NULL, 
                C1EVMLogging::C1EVM, 
                C1EVMLogging::Service, 
                C1EVMLogging::Failure, 
                NULL, NULL,
                L"realloc failed in CThreadMonitor::Monitor. Bytes requested: %d", 
                count * sizeof(HANDLE));
free(hArryPtr);

throw bad_alloc("realloc failed in CThreadMonitor::Monitor");