我试图创建例外对象创建的对象,如果这是全成我想要的是对象添加到载体。这里是我的代码:C++处理异常
try{
CCoord newCoord(input); //I'm parsing the input into several prvt variables
}
catch(...){
//it failed, just quit
}
//if no error occured, add it to the vector
vCoords.push_back(newCoord);
但我不能够访问该对象之外try
块。任何解决方案,请?
如何简单,非常感谢。 – marthin23