llvm-project
45 строк · 1011.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// bool empty() const;
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{
24typedef std::multimap<int, double> M;
25M m;
26assert(m.empty());
27m.insert(M::value_type(1, 1.5));
28assert(!m.empty());
29m.clear();
30assert(m.empty());
31}
32#if TEST_STD_VER >= 11
33{
34typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
35M m;
36assert(m.empty());
37m.insert(M::value_type(1, 1.5));
38assert(!m.empty());
39m.clear();
40assert(m.empty());
41}
42#endif
43
44return 0;
45}
46