1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // Test unique_ptr move ctor
16 // test move ctor. Should only require a MoveConstructible deleter, or if
17 // deleter is a reference, not even that.
22 #include "../../deleter.h"
28 A(const A&) {++count;}
38 return std::unique_ptr<A[]>(new A[3]);
41 void sink1(std::unique_ptr<A[]>)
45 std::unique_ptr<A[], Deleter<A[]> >
48 return std::unique_ptr<A[], Deleter<A[]> >(new A[3]);
51 void sink2(std::unique_ptr<A[], Deleter<A[]> >)
55 std::unique_ptr<A[], NCDeleter<A[]>&>
58 static NCDeleter<A[]> d;
59 return std::unique_ptr<A[], NCDeleter<A[]>&>(new A[3], d);
62 void sink3(std::unique_ptr<A[], NCDeleter<A[]>&>)
71 assert(A::count == 0);