llvm-project
42 строки · 1.0 Кб
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// <map>
10
11// class map
12
13// explicit map(const key_compare& comp);
14
15#include <map>16#include <cassert>17
18#include "test_macros.h"19#include "../../../test_compare.h"20#include "min_allocator.h"21
22int main(int, char**)23{
24{25typedef test_less<int> C;26const std::map<int, double, C> m(C(3));27assert(m.empty());28assert(m.begin() == m.end());29assert(m.key_comp() == C(3));30}31#if TEST_STD_VER >= 1132{33typedef test_less<int> C;34const std::map<int, double, C, min_allocator<std::pair<const int, double>>> m(C(3));35assert(m.empty());36assert(m.begin() == m.end());37assert(m.key_comp() == C(3));38}39#endif40
41return 0;42}
43