1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <memory>
10 
11 // shared_ptr
12 
13 // template<class T, class U> bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b);
14 // template<class T, class U> bool operator!=(const shared_ptr<T>& a, const shared_ptr<U>& b);
15 
16 #include <memory>
17 #include <cassert>
18 
19 void do_nothing(int*) {}
20 
21 int main(int, char**)
22 {
23     int* ptr1(new int);
24     int* ptr2(new int);
25     const std::shared_ptr<int> p1(ptr1);
26     const std::shared_ptr<int> p2(ptr2);
27     const std::shared_ptr<int> p3(ptr2, do_nothing);
28     assert(p1 != p2);
29     assert(p2 == p3);
30 
31   return 0;
32 }
33