File tree Expand file tree Collapse file tree 5 files changed +54
-28
lines changed
libcxx/test/std/containers
container.adaptors/flat.multimap Expand file tree Collapse file tree 5 files changed +54
-28
lines changed Original file line number Diff line number Diff line change 8
8
9
9
// <map>
10
10
11
- // class map class multimap
11
+ // class map
12
+ // class multimap
12
13
13
- // Extension: SCARY/N2913 iterator compatibility between map and multimap
14
+ // Extension: SCARY/N2913 iterator compatibility between map and multimap
14
15
15
16
#include < map>
16
17
17
18
#include " test_macros.h"
18
19
19
- int main ( int , char ** ) {
20
+ void test ( ) {
20
21
typedef std::map<int , int > M1;
21
22
typedef std::multimap<int , int > M2;
22
- M2::iterator i;
23
- M1::iterator j = i;
24
- ((void )j);
25
23
26
- return 0 ;
24
+ ASSERT_SAME_TYPE (M1::iterator, M2::iterator);
25
+ ASSERT_SAME_TYPE (M1::const_iterator, M2::const_iterator);
27
26
}
Original file line number Diff line number Diff line change 8
8
9
9
// <set>
10
10
11
- // class set class multiset
11
+ // class set
12
+ // class multiset
12
13
13
- // Extension: SCARY/N2913 iterator compatibility between set and multiset
14
+ // Extension: SCARY/N2913 iterator compatibility between set and multiset
14
15
15
16
#include < set>
16
17
17
18
#include " test_macros.h"
18
19
19
- int main ( int , char ** ) {
20
+ void test ( ) {
20
21
typedef std::set<int > M1;
21
22
typedef std::multiset<int > M2;
22
- M2::iterator i;
23
- M1::iterator j = i;
24
- ((void )j);
25
23
26
- return 0 ;
24
+ ASSERT_SAME_TYPE (M1::iterator, M2::iterator);
25
+ ASSERT_SAME_TYPE (M1::const_iterator, M2::const_iterator);
27
26
}
Original file line number Diff line number Diff line change
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
+ // <flat_map>
10
+
11
+ // class flat_map
12
+ // class flat_multimap
13
+
14
+ // Extension: SCARY/N2913 iterator compatibility between flat_map and flat_multimap
15
+
16
+ #include < flat_map>
17
+
18
+ #include " test_macros.h"
19
+
20
+ void test () {
21
+ typedef std::flat_map<int , int > M1;
22
+ typedef std::flat_multimap<int , int > M2;
23
+
24
+ ASSERT_SAME_TYPE (M1::iterator, M2::iterator);
25
+ ASSERT_SAME_TYPE (M1::const_iterator, M2::const_iterator);
26
+ }
Original file line number Diff line number Diff line change 8
8
9
9
// <unordered_map>
10
10
11
- // class unordered_map class unordered_multimap
11
+ // class unordered_map
12
+ // class unordered_multimap
12
13
13
- // Extension: SCARY/N2913 iterator compatibility between unordered_map and unordered_multimap
14
+ // Extension: SCARY/N2913 iterator compatibility between unordered_map and unordered_multimap
14
15
15
16
#include < unordered_map>
16
17
17
18
#include " test_macros.h"
18
19
19
- int main ( int , char ** ) {
20
+ void test ( ) {
20
21
typedef std::unordered_map<int , int > M1;
21
22
typedef std::unordered_multimap<int , int > M2;
22
- M2::iterator i;
23
- M1::iterator j = i;
24
- ((void )j);
25
23
26
- return 0 ;
24
+ ASSERT_SAME_TYPE (M1::iterator, M2::iterator);
25
+ ASSERT_SAME_TYPE (M1::const_iterator, M2::const_iterator);
26
+ ASSERT_SAME_TYPE (M1::local_iterator, M2::local_iterator);
27
+ ASSERT_SAME_TYPE (M1::const_local_iterator, M2::const_local_iterator);
27
28
}
Original file line number Diff line number Diff line change 8
8
9
9
// <unordered_set>
10
10
11
- // class unordered_set class unordered_multiset
11
+ // class unordered_set
12
+ // class unordered_multiset
12
13
13
- // Extension: SCARY/N2913 iterator compatibility between unordered_set and unordered_multiset
14
+ // Extension: SCARY/N2913 iterator compatibility between unordered_set and unordered_multiset
14
15
15
16
#include < unordered_set>
16
17
17
18
#include " test_macros.h"
18
19
19
- int main ( int , char ** ) {
20
+ void test ( ) {
20
21
typedef std::unordered_set<int > M1;
21
22
typedef std::unordered_multiset<int > M2;
22
- M2::iterator i;
23
- M1::iterator j = i;
24
- ((void )j);
25
23
26
- return 0 ;
24
+ ASSERT_SAME_TYPE (M1::iterator, M2::iterator);
25
+ ASSERT_SAME_TYPE (M1::const_iterator, M2::const_iterator);
26
+ ASSERT_SAME_TYPE (M1::local_iterator, M2::local_iterator);
27
+ ASSERT_SAME_TYPE (M1::const_local_iterator, M2::const_local_iterator);
27
28
}
You can’t perform that action at this time.
0 commit comments