llvm-project
52 строки · 1.3 Кб
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 allocator_type& a);
14
15#include <map>16#include <cassert>17
18#include "test_macros.h"19#include "test_allocator.h"20#include "min_allocator.h"21
22int main(int, char**)23{
24{25typedef std::less<int> C;26typedef test_allocator<std::pair<const int, double> > A;27std::map<int, double, C, A> m(A(5));28assert(m.empty());29assert(m.begin() == m.end());30assert(m.get_allocator() == A(5));31}32#if TEST_STD_VER >= 1133{34typedef std::less<int> C;35typedef min_allocator<std::pair<const int, double> > A;36std::map<int, double, C, A> m(A{});37assert(m.empty());38assert(m.begin() == m.end());39assert(m.get_allocator() == A());40}41{42typedef std::less<int> C;43typedef explicit_allocator<std::pair<const int, double> > A;44std::map<int, double, C, A> m(A{});45assert(m.empty());46assert(m.begin() == m.end());47assert(m.get_allocator() == A());48}49#endif50
51return 0;52}
53