[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / emplace.pass.cpp
blobd525371f3a701952ea0726559982d94495094b5d
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++98, c++03, c++11
10 // <vector>
11 // vector<bool>
13 // template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
15 #include <vector>
16 #include <cassert>
17 #include "test_macros.h"
18 #include "min_allocator.h"
20 int main(int, char**)
23 typedef std::vector<bool> C;
24 C c;
26 C::iterator i = c.emplace(c.cbegin());
27 assert(i == c.begin());
28 assert(c.size() == 1);
29 assert(c.front() == false);
31 i = c.emplace(c.cend(), true);
32 assert(i == c.end()-1);
33 assert(c.size() == 2);
34 assert(c.front() == false);
35 assert(c.back() == true);
37 i = c.emplace(c.cbegin()+1, true);
38 assert(i == c.begin()+1);
39 assert(c.size() == 3);
40 assert(c.front() == false);
41 assert(c[1] == true);
42 assert(c.back() == true);
45 typedef std::vector<bool, min_allocator<bool>> C;
46 C c;
48 C::iterator i = c.emplace(c.cbegin());
49 assert(i == c.begin());
50 assert(c.size() == 1);
51 assert(c.front() == false);
53 i = c.emplace(c.cend(), true);
54 assert(i == c.end()-1);
55 assert(c.size() == 2);
56 assert(c.front() == false);
57 assert(c.back() == true);
59 i = c.emplace(c.cbegin()+1, true);
60 assert(i == c.begin()+1);
61 assert(c.size() == 3);
62 assert(c.size() == 3);
63 assert(c.front() == false);
64 assert(c[1] == true);
65 assert(c.back() == true);
68 return 0;