//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // shared_ptr // template // bool operator==(const unique_ptr& x, nullptr_t) noexcept; // template // bool operator==(nullptr_t, const unique_ptr& y) noexcept; // template // bool operator!=(const unique_ptr& x, nullptr_t) noexcept; // template // bool operator!=(nullptr_t, const unique_ptr& y) noexcept; // template // bool operator<(const unique_ptr& x, nullptr_t) noexcept; // template // bool operator<(nullptr_t, const unique_ptr& y) noexcept; // template // bool operator<=(const unique_ptr& x, nullptr_t) noexcept; // template // bool operator<=(nullptr_t, const unique_ptr& y) noexcept; // template // bool operator>(const unique_ptr& x, nullptr_t) noexcept; // template // bool operator>(nullptr_t, const unique_ptr& y) noexcept; // template // bool operator>=(const unique_ptr& x, nullptr_t) noexcept; // template // bool operator>=(nullptr_t, const unique_ptr& y) noexcept; #include #include #include "test_macros.h" void do_nothing(int*) {} int main(int, char**) { const std::unique_ptr p1(new int(1)); assert(!(p1 == nullptr)); assert(!(nullptr == p1)); assert(!(p1 < nullptr)); assert( (nullptr < p1)); assert(!(p1 <= nullptr)); assert( (nullptr <= p1)); assert( (p1 > nullptr)); assert(!(nullptr > p1)); assert( (p1 >= nullptr)); assert(!(nullptr >= p1)); const std::unique_ptr p2; assert( (p2 == nullptr)); assert( (nullptr == p2)); assert(!(p2 < nullptr)); assert(!(nullptr < p2)); assert( (p2 <= nullptr)); assert( (nullptr <= p2)); assert(!(p2 > nullptr)); assert(!(nullptr > p2)); assert( (p2 >= nullptr)); assert( (nullptr >= p2)); return 0; }