TwITe

Untitled

Dec 29th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <memory>
  3. using namespace std;
  4.  
  5. class A {
  6. public:
  7.     unique_ptr<int[]> data;
  8.     //int *data;
  9.  
  10.     A(int *d) : data(d) {
  11.         //throw runtime_error("error");
  12.     }
  13. };
  14.  
  15. int main() {
  16.     int *arr = new int[3]{1, 2, 3};
  17.  
  18.     A a(arr);
  19. }
Add Comment
Please, Sign In to add comment