Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <memory>
- using namespace std;
- class A {
- public:
- unique_ptr<int[]> data;
- //int *data;
- A(int *d) : data(d) {
- //throw runtime_error("error");
- }
- };
- int main() {
- int *arr = new int[3]{1, 2, 3};
- A a(arr);
- }
Add Comment
Please, Sign In to add comment