]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/containers/associative/map/incomplete_type.pass.cpp
Vendor import of libc++ trunk r300422:
[FreeBSD/FreeBSD.git] / test / std / containers / associative / map / incomplete_type.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <map>
11
12 // Check that std::map and its iterators can be instantiated with an incomplete
13 // type.
14
15 #include <map>
16
17 struct A {
18     typedef std::map<A, A> Map;
19     int data;
20     Map m;
21     Map::iterator it;
22     Map::const_iterator cit;
23 };
24
25 inline bool operator==(A const& L, A const& R) { return &L == &R; }
26 inline bool operator<(A const& L, A const& R)  { return L.data < R.data; }
27 int main() {
28     A a;
29 }