//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <memory>
// unique_ptr
// template <class T1, class D1, class T2, class D2>
// bool
// operator==(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y);
// template <class T1, class D1, class T2, class D2>
// bool
// operator!=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y);
#include<memory>#include<cassert>#include"../deleter.h"structA{staticintcount;A(){++count;}A(constA&){++count;}virtual~A(){--count;}};intA::count=0;structB:publicA{staticintcount;B(){++count;}B(constB&){++count;}virtual~B(){--count;}};intB::count=0;intmain(){{conststd::unique_ptr<A,Deleter<A>>p1(newA);conststd::unique_ptr<A,Deleter<A>>p2(newA);assert(!(p1==p2));assert(p1!=p2);}{conststd::unique_ptr<A,Deleter<A>>p1(newA);conststd::unique_ptr<B,Deleter<B>>p2(newB);assert(!(p1==p2));assert(p1!=p2);}{conststd::unique_ptr<A[],Deleter<A[]>>p1(newA[3]);conststd::unique_ptr<A[],Deleter<A[]>>p2(newA[3]);assert(!(p1==p2));assert(p1!=p2);}{conststd::unique_ptr<A[],Deleter<A[]>>p1(newA[3]);conststd::unique_ptr<B[],Deleter<B[]>>p2(newB[3]);assert(!(p1==p2));assert(p1!=p2);}{conststd::unique_ptr<A,Deleter<A>>p1;conststd::unique_ptr<A,Deleter<A>>p2;assert(p1==p2);assert(!(p1!=p2));}{conststd::unique_ptr<A,Deleter<A>>p1;conststd::unique_ptr<B,Deleter<B>>p2;assert(p1==p2);assert(!(p1!=p2));}}