summaryrefslogtreecommitdiff
path: root/libcxx/test/extensions/gnu/hash_multiset/insert.pass.cpp
blob: 1a60cac158a400925d6b84ba278fc19a0543c8ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// ADDITIONAL_COMPILE_FLAGS: -Wno-deprecated

// hash_multimap::insert

#include <cassert>
#include <ext/hash_set>

int main(int, char**) {
  __gnu_cxx::hash_multiset<int> map;

  map.insert(1);
  map.insert(1);

  assert(map.size() == 2);
  assert(map.equal_range(1).first == map.begin());
  assert(map.equal_range(1).second == map.end());

  int arr[] = {1, 1};

  map.insert(arr, arr + 2);

  assert(map.size() == 4);
  assert(map.equal_range(1).first == map.begin());
  assert(map.equal_range(1).second == map.end());

  return 0;
}