15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier
95a83710eSEric Fiselier // <map>
105a83710eSEric Fiselier
115a83710eSEric Fiselier // class map
125a83710eSEric Fiselier
135a83710eSEric Fiselier // map(const key_compare& comp, const allocator_type& a);
145a83710eSEric Fiselier
155a83710eSEric Fiselier #include <map>
165a83710eSEric Fiselier #include <cassert>
175a83710eSEric Fiselier
187fc6a556SMarshall Clow #include "test_macros.h"
195a83710eSEric Fiselier #include "../../../test_compare.h"
205a83710eSEric Fiselier #include "test_allocator.h"
215a83710eSEric Fiselier #include "min_allocator.h"
225a83710eSEric Fiselier
main(int,char **)232df59c50SJF Bastien int main(int, char**)
245a83710eSEric Fiselier {
255a83710eSEric Fiselier {
26*5cc55fdbSArthur O'Dwyer typedef test_less<int> C;
275a83710eSEric Fiselier typedef test_allocator<std::pair<const int, double> > A;
285a83710eSEric Fiselier std::map<int, double, C, A> m(C(4), A(5));
295a83710eSEric Fiselier assert(m.empty());
305a83710eSEric Fiselier assert(m.begin() == m.end());
315a83710eSEric Fiselier assert(m.key_comp() == C(4));
325a83710eSEric Fiselier assert(m.get_allocator() == A(5));
335a83710eSEric Fiselier }
34f2f2a639SEric Fiselier #if TEST_STD_VER >= 11
355a83710eSEric Fiselier {
36*5cc55fdbSArthur O'Dwyer typedef test_less<int> C;
375a83710eSEric Fiselier typedef min_allocator<std::pair<const int, double> > A;
385a83710eSEric Fiselier std::map<int, double, C, A> m(C(4), A());
395a83710eSEric Fiselier assert(m.empty());
405a83710eSEric Fiselier assert(m.begin() == m.end());
415a83710eSEric Fiselier assert(m.key_comp() == C(4));
425a83710eSEric Fiselier assert(m.get_allocator() == A());
435a83710eSEric Fiselier }
442a10c960SMarshall Clow {
45*5cc55fdbSArthur O'Dwyer typedef test_less<int> C;
462a10c960SMarshall Clow typedef explicit_allocator<std::pair<const int, double> > A;
472a10c960SMarshall Clow std::map<int, double, C, A> m(C(4), A{});
482a10c960SMarshall Clow assert(m.empty());
492a10c960SMarshall Clow assert(m.begin() == m.end());
502a10c960SMarshall Clow assert(m.key_comp() == C(4));
512a10c960SMarshall Clow assert(m.get_allocator() == A{});
522a10c960SMarshall Clow }
535a83710eSEric Fiselier #endif
542df59c50SJF Bastien
552df59c50SJF Bastien return 0;
565a83710eSEric Fiselier }
57