[mlir][acc] Introduce MappableType interface (#122146)
[llvm-project.git] / libcxx / test / std / containers / associative / multiset / insert_initializer_list.pass.cpp
blob9c870b1298615d0a2b7fbe9bee255699e7cdaaa9
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++03
11 // <set>
13 // class multiset
15 // void insert(initializer_list<value_type> il);
17 #include <set>
18 #include <cassert>
19 #include <cstddef>
21 #include "test_macros.h"
22 #include "min_allocator.h"
24 int main(int, char**)
27 typedef std::multiset<int> C;
28 typedef C::value_type V;
29 C m = {10, 8};
30 m.insert({1, 2, 3, 4, 5, 6});
31 assert(m.size() == 8);
32 assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
33 C::const_iterator i = m.cbegin();
34 assert(*i == V(1));
35 assert(*++i == V(2));
36 assert(*++i == V(3));
37 assert(*++i == V(4));
38 assert(*++i == V(5));
39 assert(*++i == V(6));
40 assert(*++i == V(8));
41 assert(*++i == V(10));
44 typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
45 typedef C::value_type V;
46 C m = {10, 8};
47 m.insert({1, 2, 3, 4, 5, 6});
48 assert(m.size() == 8);
49 assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
50 C::const_iterator i = m.cbegin();
51 assert(*i == V(1));
52 assert(*++i == V(2));
53 assert(*++i == V(3));
54 assert(*++i == V(4));
55 assert(*++i == V(5));
56 assert(*++i == V(6));
57 assert(*++i == V(8));
58 assert(*++i == V(10));
61 return 0;