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 
15 #include <memory>
16 #include <cassert>
17 
18 void do_nothing(int*) {}
19 
20 int main(int, char**)
21 {
22     int* ptr1(new int);
23     int* ptr2(new int);
24     const std::shared_ptr<int> p1(ptr1);
25     const std::shared_ptr<int> p2(ptr2);
26     const std::shared_ptr<int> p3(ptr2, do_nothing);
27     assert((p1 < p2) == (ptr1 < ptr2));
28     assert(!(p2 < p3) && !(p3 < p2));
29 
30   return 0;
31 }
32