OSDN Git Service

* configure.ac: Do not check for gconv.h.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / util / regression / rand / assoc / detail / defs_fn_imps.hpp
1 // -*- C++ -*-
2
3 // Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library.  This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 2, or (at your option) any later
9 // version.
10
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // General Public License for more details.
15
16 // You should have received a copy of the GNU General Public License
17 // along with this library; see the file COPYING.  If not, write to
18 // the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19 // MA 02111-1307, USA.
20
21 // As a special exception, you may use this file as part of a free
22 // software library without restriction.  Specifically, if other files
23 // instantiate templates or use macros or inline functions from this
24 // file, or you compile this file and link it with other files to
25 // produce an executable, this file does not by itself cause the
26 // resulting executable to be covered by the GNU General Public
27 // License.  This exception does not however invalidate any other
28 // reasons why the executable file might be covered by the GNU General
29 // Public License.
30
31 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
32
33 // Permission to use, copy, modify, sell, and distribute this software
34 // is hereby granted without fee, provided that the above copyright
35 // notice appears in all copies, and that both that copyright notice
36 // and this permission notice appear in supporting documentation. None
37 // of the above authors, nor IBM Haifa Research Laboratories, make any
38 // representation about the suitability of this software for any
39 // purpose. It is provided "as is" without express or implied
40 // warranty.
41
42 /**
43  * @file defs_fn_imps.hpp
44  * Containsert a random regression test for a specific container type.
45  */
46
47 PB_DS_CLASS_T_DEC
48 void
49 PB_DS_CLASS_C_DEC::
50 defs()
51 {
52   // General container types.
53
54   typedef typename Cntnr::size_type test_size_type;
55
56   typedef typename Cntnr::difference_type difference_type;
57
58   key_defs();
59
60   mapped_defs();
61
62   value_defs();
63
64   iterator_defs();
65
66   node_iterator_defs(__gnu_pbds::detail::integral_constant<int,
67                      container_traits::order_preserving>());
68
69   policy_defs();
70 }
71
72 PB_DS_CLASS_T_DEC
73 void
74 PB_DS_CLASS_C_DEC::
75 key_defs()
76 {
77   typedef typename Cntnr::key_type test_key_type;
78
79   typedef typename Cntnr::key_reference test_key_reference;
80
81   typedef typename Cntnr::const_key_reference test_const_key_reference;
82
83   typedef typename Cntnr::key_pointer test_key_pointer;
84
85   typedef typename Cntnr::const_key_pointer test_const_key_pointer;
86 }
87
88 PB_DS_CLASS_T_DEC
89 void
90 PB_DS_CLASS_C_DEC::
91 mapped_defs()
92 {
93   typedef typename Cntnr::mapped_type test_mapped_type;
94
95   typedef typename Cntnr::mapped_reference test_mapped_reference;
96
97   typedef
98     typename Cntnr::const_mapped_reference
99     test_const_mapped_reference;
100
101   typedef typename Cntnr::mapped_pointer test_mapped_pointer;
102
103   typedef typename Cntnr::const_mapped_pointer test_const_mapped_pointer;
104 }
105
106 PB_DS_CLASS_T_DEC
107 void
108 PB_DS_CLASS_C_DEC::
109 value_defs()
110 {
111   typedef typename Cntnr::value_type test_value_type;
112
113   typedef typename Cntnr::reference test_reference;
114
115   typedef typename Cntnr::const_reference test_const_reference;
116
117   typedef typename Cntnr::pointer test_pointer;
118
119   typedef typename Cntnr::const_pointer test_const_pointer;
120 }
121
122 PB_DS_CLASS_T_DEC
123 void
124 PB_DS_CLASS_C_DEC::
125 ds_defs()
126 {
127   typedef __gnu_pbds::container_traits< Cntnr> test_container_traits;
128
129   typedef typename test_container_traits::container_category test_container_category;
130
131   typedef
132     typename test_container_traits::invalidation_guarantee
133     test_invalidation_guarantee;
134
135   enum
136     {
137       test_order_preserving =
138       test_container_traits::order_preserving
139     };
140
141   enum
142     {
143       test_erase_can_throw =
144       test_container_traits::erase_can_throw
145     };
146 }
147
148 PB_DS_CLASS_T_DEC
149 void
150 PB_DS_CLASS_C_DEC::
151 iterator_defs()
152 {
153   typedef typename Cntnr::point_iterator test_point_iterator;
154
155   typedef typename Cntnr::const_point_iterator const_test_point_iterator;
156
157   typedef typename Cntnr::iterator test_iterator;
158
159   typedef typename Cntnr::const_iterator const_test_iterator;
160 }
161
162 PB_DS_CLASS_T_DEC
163 void
164 PB_DS_CLASS_C_DEC::
165 node_iterator_defs(__gnu_pbds::detail::false_type)
166 { }
167
168 PB_DS_CLASS_T_DEC
169 void
170 PB_DS_CLASS_C_DEC::
171 node_iterator_defs(__gnu_pbds::detail::true_type)
172 {
173   typedef typename Cntnr::node_iterator test_node_iterator;
174
175   typedef typename Cntnr::const_node_iterator test_const_node_iterator;
176 }
177
178 PB_DS_CLASS_T_DEC
179 void
180 PB_DS_CLASS_C_DEC::
181 policy_defs()
182 {
183   typedef typename Cntnr::allocator_type test_allocator;
184
185   policy_defs(typename Cntnr::container_category());
186 }
187
188 PB_DS_CLASS_T_DEC
189 void
190 PB_DS_CLASS_C_DEC::
191 policy_defs(__gnu_pbds::basic_hash_tag)
192 {
193   typedef typename Cntnr::hash_fn test_hash_fn;
194
195   typedef typename Cntnr::eq_fn test_eq_fn;
196
197   typedef typename Cntnr::resize_policy test_resize_policy;
198 }
199
200 PB_DS_CLASS_T_DEC
201 void
202 PB_DS_CLASS_C_DEC::
203 policy_defs(__gnu_pbds::cc_hash_tag)
204 {
205   policy_defs(__gnu_pbds::basic_hash_tag());
206
207   typedef typename Cntnr::comb_hash_fn test_comb_hash_fn;
208 }
209
210 PB_DS_CLASS_T_DEC
211 void
212 PB_DS_CLASS_C_DEC::
213 policy_defs(__gnu_pbds::gp_hash_tag)
214 {
215   policy_defs(__gnu_pbds::basic_hash_tag());
216
217   typedef typename Cntnr::comb_probe_fn test_comb_probe_fn;
218
219   typedef typename Cntnr::probe_fn test_probe_fn;
220 }
221
222 PB_DS_CLASS_T_DEC
223 void
224 PB_DS_CLASS_C_DEC::
225 policy_defs(__gnu_pbds::tree_tag)
226 {
227   typedef typename Cntnr::cmp_fn test_cmp_fn;
228
229   typedef typename Cntnr::node_update test_node_update;
230 }
231
232 PB_DS_CLASS_T_DEC
233 void
234 PB_DS_CLASS_C_DEC::
235 policy_defs(__gnu_pbds::list_update_tag)
236 {
237   typedef typename Cntnr::eq_fn test_eq_fn;
238
239   typedef typename Cntnr::update_policy test_update_policy;
240 }
241
242 PB_DS_CLASS_T_DEC
243 void
244 PB_DS_CLASS_C_DEC::
245 policy_defs(__gnu_pbds::pat_trie_tag)
246 {
247   typedef typename Cntnr::e_access_traits e_access_traits;
248 }