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// ADDITIONAL_COMPILE_FLAGS: -Wno-deprecated
10
11// hash_multimap::insert
12
13#include <cassert>
14#include <ext/hash_set>
15
16int main(int, char**) {
17 __gnu_cxx::hash_multiset<int> map;
18
19 map.insert(obj: 1);
20 map.insert(obj: 1);
21
22 assert(map.size() == 2);
23 assert(map.equal_range(1).first == map.begin());
24 assert(map.equal_range(1).second == map.end());
25
26 int arr[] = {1, 1};
27
28 map.insert(f: arr, l: arr + 2);
29
30 assert(map.size() == 4);
31 assert(map.equal_range(1).first == map.begin());
32 assert(map.equal_range(1).second == map.end());
33
34 return 0;
35}
36

source code of libcxx/test/extensions/gnu/hash_multiset/insert.pass.cpp