43 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// UNSUPPORTED: c++0310 11// <queue>12 13// priority_queue();14 15// template <class... Args> void emplace(Args&&... args);16 17#include <queue>18#include <cassert>19 20#include "test_macros.h"21#include "../../../Emplaceable.h"22 23TEST_CONSTEXPR_CXX26 bool test() {24 std::priority_queue<Emplaceable> q;25 q.emplace(1, 2.5);26 assert(q.top() == Emplaceable(1, 2.5));27 q.emplace(3, 4.5);28 assert(q.top() == Emplaceable(3, 4.5));29 q.emplace(2, 3.5);30 assert(q.top() == Emplaceable(3, 4.5));31 32 return true;33}34 35int main(int, char**) {36 assert(test());37#if TEST_STD_VER >= 2638 static_assert(test());39#endif40 41 return 0;42}43