llvm-project
37 строк · 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 multimap
12
13// allocator_type get_allocator() const
14
15#include <map>
16#include <cassert>
17#include <string>
18
19#include "test_allocator.h"
20#include "test_macros.h"
21
22int main(int, char**) {
23typedef std::pair<const int, std::string> ValueType;
24{
25std::allocator<ValueType> alloc;
26const std::multimap<int, std::string> m(alloc);
27assert(m.get_allocator() == alloc);
28}
29{
30other_allocator<ValueType> alloc(1);
31const std::multimap<int, std::string, std::less<int>,
32other_allocator<ValueType> > m(alloc);
33assert(m.get_allocator() == alloc);
34}
35
36return 0;
37}
38