Upstream version 8.36.169.0
[platform/framework/web/crosswalk.git] / src / third_party / libc++ / trunk / test / containers / container.adaptors / priority.queue / priqueue.cons / ctor_copy.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <queue>
11
12 // priority_queue(const priority_queue&) = default;
13
14 #include <queue>
15 #include <cassert>
16 #include <functional>
17
18 template <class C>
19 C
20 make(int n)
21 {
22     C c;
23     for (int i = 0; i < n; ++i)
24         c.push_back(i);
25     return c;
26 }
27
28 int main()
29 {
30     std::vector<int> v = make<std::vector<int> >(5);
31     std::priority_queue<int, std::vector<int>, std::greater<int> > qo(std::greater<int>(), v);
32     std::priority_queue<int, std::vector<int>, std::greater<int> > q = qo;
33     assert(q.size() == 5);
34     assert(q.top() == 0);
35 }