2008-07-03 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / libstdc++-v3 / testsuite / util / regression / rand / assoc / detail / defs_fn_imps.hpp
blob0acb20cd62e01138aca66990082af8de4ff190fb
1 // -*- C++ -*-
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.
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.
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.
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.
31 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
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.
42 /**
43 * @file defs_fn_imps.hpp
44 * Containsert a random regression test for a specific container type.
47 PB_DS_CLASS_T_DEC
48 void
49 PB_DS_CLASS_C_DEC::
50 defs()
52 // General container types.
54 typedef typename Cntnr::size_type test_size_type;
56 typedef typename Cntnr::difference_type difference_type;
58 key_defs();
60 mapped_defs();
62 value_defs();
64 iterator_defs();
66 node_iterator_defs(__gnu_pbds::detail::integral_constant<int,
67 container_traits::order_preserving>());
69 policy_defs();
72 PB_DS_CLASS_T_DEC
73 void
74 PB_DS_CLASS_C_DEC::
75 key_defs()
77 typedef typename Cntnr::key_type test_key_type;
79 typedef typename Cntnr::key_reference test_key_reference;
81 typedef typename Cntnr::const_key_reference test_const_key_reference;
83 typedef typename Cntnr::key_pointer test_key_pointer;
85 typedef typename Cntnr::const_key_pointer test_const_key_pointer;
88 PB_DS_CLASS_T_DEC
89 void
90 PB_DS_CLASS_C_DEC::
91 mapped_defs()
93 typedef typename Cntnr::mapped_type test_mapped_type;
95 typedef typename Cntnr::mapped_reference test_mapped_reference;
97 typedef
98 typename Cntnr::const_mapped_reference
99 test_const_mapped_reference;
101 typedef typename Cntnr::mapped_pointer test_mapped_pointer;
103 typedef typename Cntnr::const_mapped_pointer test_const_mapped_pointer;
106 PB_DS_CLASS_T_DEC
107 void
108 PB_DS_CLASS_C_DEC::
109 value_defs()
111 typedef typename Cntnr::value_type test_value_type;
113 typedef typename Cntnr::reference test_reference;
115 typedef typename Cntnr::const_reference test_const_reference;
117 typedef typename Cntnr::pointer test_pointer;
119 typedef typename Cntnr::const_pointer test_const_pointer;
122 PB_DS_CLASS_T_DEC
123 void
124 PB_DS_CLASS_C_DEC::
125 ds_defs()
127 typedef __gnu_pbds::container_traits< Cntnr> test_container_traits;
129 typedef typename test_container_traits::container_category test_container_category;
131 typedef
132 typename test_container_traits::invalidation_guarantee
133 test_invalidation_guarantee;
135 enum
137 test_order_preserving =
138 test_container_traits::order_preserving
141 enum
143 test_erase_can_throw =
144 test_container_traits::erase_can_throw
148 PB_DS_CLASS_T_DEC
149 void
150 PB_DS_CLASS_C_DEC::
151 iterator_defs()
153 typedef typename Cntnr::point_iterator test_point_iterator;
155 typedef typename Cntnr::const_point_iterator const_test_point_iterator;
157 typedef typename Cntnr::iterator test_iterator;
159 typedef typename Cntnr::const_iterator const_test_iterator;
162 PB_DS_CLASS_T_DEC
163 void
164 PB_DS_CLASS_C_DEC::
165 node_iterator_defs(__gnu_pbds::detail::false_type)
168 PB_DS_CLASS_T_DEC
169 void
170 PB_DS_CLASS_C_DEC::
171 node_iterator_defs(__gnu_pbds::detail::true_type)
173 typedef typename Cntnr::node_iterator test_node_iterator;
175 typedef typename Cntnr::const_node_iterator test_const_node_iterator;
178 PB_DS_CLASS_T_DEC
179 void
180 PB_DS_CLASS_C_DEC::
181 policy_defs()
183 typedef typename Cntnr::allocator test_allocator;
185 policy_defs(typename Cntnr::container_category());
188 PB_DS_CLASS_T_DEC
189 void
190 PB_DS_CLASS_C_DEC::
191 policy_defs(__gnu_pbds::basic_hash_tag)
193 typedef typename Cntnr::hash_fn test_hash_fn;
195 typedef typename Cntnr::eq_fn test_eq_fn;
197 typedef typename Cntnr::resize_policy test_resize_policy;
200 PB_DS_CLASS_T_DEC
201 void
202 PB_DS_CLASS_C_DEC::
203 policy_defs(__gnu_pbds::cc_hash_tag)
205 policy_defs(__gnu_pbds::basic_hash_tag());
207 typedef typename Cntnr::comb_hash_fn test_comb_hash_fn;
210 PB_DS_CLASS_T_DEC
211 void
212 PB_DS_CLASS_C_DEC::
213 policy_defs(__gnu_pbds::gp_hash_tag)
215 policy_defs(__gnu_pbds::basic_hash_tag());
217 typedef typename Cntnr::comb_probe_fn test_comb_probe_fn;
219 typedef typename Cntnr::probe_fn test_probe_fn;
222 PB_DS_CLASS_T_DEC
223 void
224 PB_DS_CLASS_C_DEC::
225 policy_defs(__gnu_pbds::tree_tag)
227 typedef typename Cntnr::cmp_fn test_cmp_fn;
229 typedef typename Cntnr::node_update test_node_update;
232 PB_DS_CLASS_T_DEC
233 void
234 PB_DS_CLASS_C_DEC::
235 policy_defs(__gnu_pbds::list_update_tag)
237 typedef typename Cntnr::eq_fn test_eq_fn;
239 typedef typename Cntnr::update_policy test_update_policy;
242 PB_DS_CLASS_T_DEC
243 void
244 PB_DS_CLASS_C_DEC::
245 policy_defs(__gnu_pbds::pat_trie_tag)
247 typedef typename Cntnr::e_access_traits e_access_traits;