brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · f74723b Raw
56 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// <map>10 11// class multimap12 13// multimap();14 15#include <map>16#include <cassert>17 18#include "test_macros.h"19#include "min_allocator.h"20 21int main(int, char**) {22  {23    std::multimap<int, double> m;24    assert(m.empty());25    assert(m.begin() == m.end());26  }27#if TEST_STD_VER >= 1128  {29    std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> m;30    assert(m.empty());31    assert(m.begin() == m.end());32  }33  {34    typedef explicit_allocator<std::pair<const int, double>> A;35    {36      std::multimap<int, double, std::less<int>, A> m;37      assert(m.empty());38      assert(m.begin() == m.end());39    }40    {41      A a;42      std::multimap<int, double, std::less<int>, A> m(a);43      assert(m.empty());44      assert(m.begin() == m.end());45    }46  }47  {48    std::multimap<int, double> m = {};49    assert(m.empty());50    assert(m.begin() == m.end());51  }52#endif53 54  return 0;55}56