Overcoming std::bad_alloc in a constructor without std::nothrow

后端 未结 0 1672
醉酒成梦
醉酒成梦 2020-12-14 08:25

Let\'s say I have a class that looks like this:

Class A{
 private:
   int* A1;
   int* A2;
 public:
   A(): A1(new int[1000]), A2(new int[1000]){}         
           


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题