Debian Codegraph @

libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.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 // UNSUPPORTED: c++03
10
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
23 int main(int, char**)
24 {
25 std::priority_queue<Emplaceable> q;
26 q.emplace(1, 2.5);
27 assert(q.top() == Emplaceable(1, 2.5));
28 q.emplace(3, 4.5);
29 assert(q.top() == Emplaceable(3, 4.5));
30 q.emplace(2, 3.5);
31 assert(q.top() == Emplaceable(3, 4.5));
32
33 return 0;
34 }