Debian Codegraph @

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/not_less_than.compile.fail.cpp

raw
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 // template <class T> class weak_ptr;
12 //
13 // not less than comparable
14
15 #include <memory>
16 #include <cassert>
17
18 int main(int, char**)
19 {
20 const std::shared_ptr<int> p1(new int);
21 const std::shared_ptr<int> p2(new int);
22 const std::weak_ptr<int> w1(p1);
23 const std::weak_ptr<int> w2(p2);
24
25 bool b = w1 < w2;
26
27 return 0;
28 }