Home | History | Annotate | Download | only in SemaCXX

Lines Matching defs:unique_ptr

4 class unique_ptr {
7 unique_ptr(const unique_ptr&) = delete; // expected-note 3{{'unique_ptr' has been explicitly marked deleted here}}
8 unique_ptr &operator=(const unique_ptr&) = delete; // expected-note{{candidate function has been explicitly deleted}}
10 unique_ptr() : ptr(0) { }
11 unique_ptr(unique_ptr &&other) : ptr(other.ptr) { other.ptr = 0; }
12 explicit unique_ptr(T *ptr) : ptr(ptr) { }
14 ~unique_ptr() { delete ptr; }
16 unique_ptr &operator=(unique_ptr &&other) { // expected-note{{candidate function not viable: no known conversion from 'unique_ptr<int>' to 'unique_ptr<int> &&' for 1st argument}}
56 unique_ptr<T> make_unique_ptr(Args &&...args) {
57 return unique_ptr<T>(new T(forward<Args>(args)...));
60 template<typename T> void accept_unique_ptr(unique_ptr<T>); // expected-note{{passing argument to parameter here}}
62 unique_ptr<int> test_unique_ptr() {
64 unique_ptr<int> p;
65 unique_ptr<int> p1(new int);
68 unique_ptr<int> p2(make_unique_ptr<int>(17));
69 unique_ptr<int> p3 = make_unique_ptr<int>(17);
72 unique_ptr<int> p4(p); // expected-error{{call to deleted constructor of 'unique_ptr<int>'}}
73 unique_ptr<int> p5 = p; // expected-error{{call to deleted constructor of 'unique_ptr<int>'}}
87 accept_unique_ptr(p); // expected-error{{call to deleted constructor of 'unique_ptr<int>'}}