46 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <queue>10 11// priority_queue();12 13// void pop();14 15#include <queue>16#include <cassert>17 18#include "test_macros.h"19 20TEST_CONSTEXPR_CXX26 bool test() {21 std::priority_queue<int> q;22 q.push(1);23 assert(q.top() == 1);24 q.push(3);25 assert(q.top() == 3);26 q.push(2);27 assert(q.top() == 3);28 q.pop();29 assert(q.top() == 2);30 q.pop();31 assert(q.top() == 1);32 q.pop();33 assert(q.empty());34 35 return true;36}37 38int main(int, char**) {39 assert(test());40#if TEST_STD_VER >= 2641 static_assert(test());42#endif43 44 return 0;45}46