brintos

brintos / llvm-project-archived public Read only

0
0
Text · 907 B · 1a60cac Raw
36 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// ADDITIONAL_COMPILE_FLAGS: -Wno-deprecated10 11// hash_multimap::insert12 13#include <cassert>14#include <ext/hash_set>15 16int main(int, char**) {17  __gnu_cxx::hash_multiset<int> map;18 19  map.insert(1);20  map.insert(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(arr, 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